Skip to content

Fix variable import to correctly handle falsy values#64362

Merged
potiuk merged 1 commit intoapache:mainfrom
henry3260:fix-edge-case-in-cli-import
Mar 30, 2026
Merged

Fix variable import to correctly handle falsy values#64362
potiuk merged 1 commit intoapache:mainfrom
henry3260:fix-edge-case-in-cli-import

Conversation

@henry3260
Copy link
Copy Markdown
Contributor

Why

When importing variables from a JSON file using the dict format like
({"mykey": {"value": ""}}), falsy values such as empty string (""),
0, or False were incorrectly handled. The code used v.get("value")
in a truthy check, causing the entire dict to be treated as the value instead
of extracting the actual (falsy) value. This led to incorrect data being
imported.

This bug affected users who store empty strings, zero values, or boolean
false in variables via the CLI import command.

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

@henry3260 henry3260 force-pushed the fix-edge-case-in-cli-import branch from 1c5ee8b to 3503f5d Compare March 28, 2026 14:59
@potiuk potiuk added the backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch label Mar 30, 2026
@potiuk potiuk merged commit a908450 into apache:main Mar 30, 2026
93 checks passed
@github-actions github-actions bot added this to the Airflow 3.2.1 milestone Mar 30, 2026
@github-actions
Copy link
Copy Markdown

Hi maintainer, this PR was merged without a milestone set.
We've automatically set the milestone to Airflow 3.2.1 based on: backport label targeting v3-2-test
If this milestone is not correct, please update it to the appropriate milestone.

This comment was generated by Milestone Tag Assistant.

github-actions bot pushed a commit that referenced this pull request Mar 30, 2026
…y values (#64362)

(cherry picked from commit a908450)

Co-authored-by: Henry Chen <henryhenry0512@gmail.com>
@github-actions
Copy link
Copy Markdown

Backport successfully created: v3-2-test

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
v3-2-test PR Link

@henry3260 henry3260 deleted the fix-edge-case-in-cli-import branch April 4, 2026 04:37
Suraj-kumar00 pushed a commit to Suraj-kumar00/airflow that referenced this pull request Apr 7, 2026
potiuk pushed a commit that referenced this pull request Apr 8, 2026
…y values (#64362) (#64448)

(cherry picked from commit a908450)

Co-authored-by: Henry Chen <henryhenry0512@gmail.com>
vatsrahul1001 pushed a commit that referenced this pull request Apr 8, 2026
…y values (#64362) (#64448)

(cherry picked from commit a908450)

Co-authored-by: Henry Chen <henryhenry0512@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:airflow-ctl backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants