Skip to content

(") to (') conversion in import variables is messing up the json value in Airflow 3 #51052

@SeiilkanM

Description

@SeiilkanM

Apache Airflow version

3.0.1

If "Other Airflow 2 version" selected, which one?

No response

What happened?

When the variables from old environment are imported in JSON file via Airflow--> Admin--> Import Variables, it is converting the (") around keys and values both to (')characters. And it is also complaining about the (') character as it is expecting (") characters.

To validate this, added a dag to access all the airflow vars and specifically load the json value to ensure if " to ' conversion is just a UI thing or an actual backend bug. So it looks like the import option is messing up the json value and that would cause an issue when accessing the airflow variable value.
While adding the variable manually from the right hand side option via “Add Variable” button seems to be working fine as of now.

Sample of JSON file:

{
  "test_string": "abcd",
  "test_num": 123,
  "test_bool": true,
  "test_json": {"test_var": "test_val"}
}

What you think should happen instead?

No response

How to reproduce

Airflow--> Admin--> Import Variables, specifically load the json value to ensure if " to ' conversion

Operating System

macOS

Versions of Apache Airflow Providers

No response

Deployment

Astronomer

Deployment details

No response

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

Labels

area:UIRelated to UI/UX. For Frontend Developers.area:corekind:bugThis is a clearly a bugpriority:mediumBug that should be fixed before next release but would not block a release

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions