Skip to content

Conversation

@HsiuChuanHsu
Copy link
Contributor

Description

The configuration passed to the airflow dags backfill command using the --dag_run_conf argument was not being correctly parsed as a JSON string.

Problem: Cause the ValueError: not enough values to unpack (expected 2, got 1)

Screenshot 2025-10-04 at 9 31 45 AM

Changes

  • Parse dag_run_conf from JSON string to dict when provided
  • Add proper error handling for invalid JSON

Close: #56230


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@HsiuChuanHsu HsiuChuanHsu force-pushed the fix/cli-backfill-dag-conf-json-parsing branch from b0b9fc6 to bd03243 Compare October 4, 2025 15:26
Copy link
Member

@hussein-awala hussein-awala left a comment

Choose a reason for hiding this comment

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

Looks good, LGTM

Note: It is not possible to run the unit tests (even existing ones) successfully in the IDE, because the local user is not "root", we may need to fix them later.

@potiuk potiuk added the backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch label Oct 13, 2025
@potiuk potiuk merged commit 6bcf3e8 into apache:main Oct 13, 2025
62 checks passed
github-actions bot pushed a commit that referenced this pull request Oct 13, 2025
…ags backfill CLI (#56380)

* feat: Parse and validate JSON for --dag-run-conf in backfill command
Add import json and update the argument parsing in create_backfill.

* unit tests covering valid JSON, invalid JSON, and empty JSON cases
(cherry picked from commit 6bcf3e8)

Co-authored-by: Gary Hsu <[email protected]>
@github-actions
Copy link

Backport successfully created: v3-1-test

Status Branch Result
v3-1-test PR Link

github-actions bot pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Oct 13, 2025
…ags backfill CLI (apache#56380)

* feat: Parse and validate JSON for --dag-run-conf in backfill command
Add import json and update the argument parsing in create_backfill.

* unit tests covering valid JSON, invalid JSON, and empty JSON cases
(cherry picked from commit 6bcf3e8)

Co-authored-by: Gary Hsu <[email protected]>
@HsiuChuanHsu
Copy link
Contributor Author

Thanks for the review! 🤩

@HsiuChuanHsu HsiuChuanHsu deleted the fix/cli-backfill-dag-conf-json-parsing branch October 13, 2025 22:48
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 14, 2025
… CLI (apache#56380)

* feat: Parse and validate JSON for --dag-run-conf in backfill command
Add import json and update the argument parsing in create_backfill.

* unit tests covering valid JSON, invalid JSON, and empty JSON cases
potiuk pushed a commit that referenced this pull request Oct 14, 2025
…ags backfill CLI (#56380) (#56599)

* feat: Parse and validate JSON for --dag-run-conf in backfill command
Add import json and update the argument parsing in create_backfill.

* unit tests covering valid JSON, invalid JSON, and empty JSON cases
(cherry picked from commit 6bcf3e8)

Co-authored-by: Gary Hsu <[email protected]>
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 15, 2025
… CLI (apache#56380)

* feat: Parse and validate JSON for --dag-run-conf in backfill command
Add import json and update the argument parsing in create_backfill.

* unit tests covering valid JSON, invalid JSON, and empty JSON cases
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 17, 2025
… CLI (apache#56380)

* feat: Parse and validate JSON for --dag-run-conf in backfill command
Add import json and update the argument parsing in create_backfill.

* unit tests covering valid JSON, invalid JSON, and empty JSON cases
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 19, 2025
… CLI (apache#56380)

* feat: Parse and validate JSON for --dag-run-conf in backfill command
Add import json and update the argument parsing in create_backfill.

* unit tests covering valid JSON, invalid JSON, and empty JSON cases
TyrellHaywood pushed a commit to TyrellHaywood/airflow that referenced this pull request Oct 22, 2025
… CLI (apache#56380)

* feat: Parse and validate JSON for --dag-run-conf in backfill command
Add import json and update the argument parsing in create_backfill.

* unit tests covering valid JSON, invalid JSON, and empty JSON cases
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:CLI backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI backfill command does not marshall configuration

3 participants