Skip to content

Fix variables import with structured falsy values#67060

Open
Leondon9 wants to merge 2 commits into
apache:mainfrom
Leondon9:codex/variables-import-20260517
Open

Fix variables import with structured falsy values#67060
Leondon9 wants to merge 2 commits into
apache:mainfrom
Leondon9:codex/variables-import-20260517

Conversation

@Leondon9
Copy link
Copy Markdown
Contributor

Fix variable import handling for structured falsy values.

This keeps core CLI and airflowctl import semantics aligned when a variable entry is shaped like {"value": ..., "description": ...} and the value is falsy, such as an empty string, 0, false, or null.

It also makes airflowctl variables import reject non-object JSON input with the existing invalid-file error instead of failing later while iterating.

Tests:

  • breeze run pytest airflow-ctl/tests/airflow_ctl/ctl/commands/test_variable_command.py -xvs
  • breeze run pytest airflow-core/tests/unit/cli/commands/test_variable_command.py::TestCliVariables::test_variables_import_with_structured_falsy_values -xvs
  • prek run ruff --files airflow-core/src/airflow/cli/commands/variable_command.py airflow-core/tests/unit/cli/commands/test_variable_command.py airflow-ctl/src/airflowctl/ctl/commands/variable_command.py airflow-ctl/tests/airflow_ctl/ctl/commands/test_variable_command.py

Was generative AI tooling used to co-author this PR?
  • Yes — Codex (GPT-5)

Generated-by: Codex (GPT-5) following the guidelines

@@ -0,0 +1 @@
Fix variable import handling for structured falsy values.
Copy link
Copy Markdown
Contributor

@Prab-27 Prab-27 May 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this ? I believe - It's related any major changes
WDYT ?

Copy link
Copy Markdown
Contributor

@bugraoz93 bugraoz93 May 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are generating this while releasing. Indeed it doesn't need for any PR. Seems we are missing comment on top of document

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to see it has already implemented ! @bugraoz93 , Do we also need to add a prek hook for it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants