Apache Airflow version
3.1.3
If "Other Airflow 2/3 version" selected, which one?
No response
What happened?
Starting with Airflow 3.x, the UI no longer preserves the original formatting of variable values.
In Airflow 2.11.x and earlier, when a variable contained structured or multi-line content (e.g., JSON, YAML, or configuration text), the UI displayed the value exactly as stored — including indentation, line breaks, and whitespace. This allowed users to easily read, validate, and edit configuration content directly from the interface.
In Airflow 3.x, the same values are now shown in a compact, single-line format, ignoring all original formatting — even though the value remains correctly formatted in the metadata database. This affects readability and editing, and introduces usability issues for workflows where variables contain structured configuration.
For users storing YAML or other whitespace-sensitive formats, this behavior can also lead to unintentional task failures if the edited, minified content is saved back.
What you think should happen instead?
When viewing the list of variables, the current behavior — displaying values in a condensed single-line preview — is acceptable and useful.
However, when the user clicks a variable (either through the key link or the "Edit" action), the UI should display the original stored formatting, including:
- line breaks
- indentation
- whitespace
preserving the "original stored" JSON/YAML formatting.
In other words, the variable editor should present the variable exactly as it exists in the metadata database, rather than showing a minified or collapsed version.
This restores the behavior that existed in Airflow ≤ 2.11 and ensures variables containing structured data remain readable and editable within the UI.
How to reproduce
- Create a variable using a multi-line formatted value, for example:
airflow variables set x "$(cat << 'EOF'
{
"key": "val",
"key2": "val2"
}
EOF
)"
- Retrieve the value using the CLI to confirm formatting is preserved:
Expected output:
{
"key": "val",
"key2": "val2"
}
- Open the Airflow UI and navigate to Admin → Variables.
- Locate and view the same variable in the UI.
- Observed behavior:
Operating System
Docker Image
Versions of Apache Airflow Providers
No response
Deployment
Docker-Compose
Deployment details
No response
Anything else?
No response
Are you willing to submit PR?
Code of Conduct
Apache Airflow version
3.1.3
If "Other Airflow 2/3 version" selected, which one?
No response
What happened?
Starting with Airflow 3.x, the UI no longer preserves the original formatting of variable values.
In Airflow 2.11.x and earlier, when a variable contained structured or multi-line content (e.g., JSON, YAML, or configuration text), the UI displayed the value exactly as stored — including indentation, line breaks, and whitespace. This allowed users to easily read, validate, and edit configuration content directly from the interface.
In Airflow 3.x, the same values are now shown in a compact, single-line format, ignoring all original formatting — even though the value remains correctly formatted in the metadata database. This affects readability and editing, and introduces usability issues for workflows where variables contain structured configuration.
For users storing YAML or other whitespace-sensitive formats, this behavior can also lead to unintentional task failures if the edited, minified content is saved back.
What you think should happen instead?
When viewing the list of variables, the current behavior — displaying values in a condensed single-line preview — is acceptable and useful.
However, when the user clicks a variable (either through the key link or the "Edit" action), the UI should display the original stored formatting, including:
preserving the "original stored" JSON/YAML formatting.
In other words, the variable editor should present the variable exactly as it exists in the metadata database, rather than showing a minified or collapsed version.
This restores the behavior that existed in Airflow ≤ 2.11 and ensures variables containing structured data remain readable and editable within the UI.
How to reproduce
Expected output:
{ "key": "val", "key2": "val2" }Operating System
Docker Image
Versions of Apache Airflow Providers
No response
Deployment
Docker-Compose
Deployment details
No response
Anything else?
No response
Are you willing to submit PR?
Code of Conduct