Skip to content

Fix airflowctl list argument parsing - #72454

Merged
potiuk merged 1 commit into
apache:mainfrom
auyua9:codex/airflowctl-list-parser-auyua9
Sep 7, 2026
Merged

potiuk merged 1 commit into
apache:mainfrom
auyua9:codex/airflowctl-list-parser-auyua9

Conversation

@auyua9

@auyua9 auyua9 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Use Airflow's existing string_list_type parser when airflowctl generates arguments for OpenAPI list parameters.
Add a focused regression test for comma-separated values.

Why

The generated CLI currently maps list to Python's built-in list. In an argparse type= callback, that turns dag1,dag2 into a list of characters rather than two DAG IDs. The repository already uses string_list_type for comma-separated list arguments, and the adjacent dict mapping was recently corrected to use json_dict_type in PR #68985.

Tests

  • uv run --project /Users/ming/code/apache/airflow-pr-attempt50/airflow-ctl pytest airflow-ctl/tests/airflow_ctl/ctl/test_cli_config.py -q
  • uv run --project /Users/ming/code/apache/airflow-pr-attempt50/airflow-ctl ruff check airflow-ctl/src/airflowctl/ctl/cli_config.py airflow-ctl/tests/airflow_ctl/ctl/test_cli_config.py
  • uv run --project /Users/ming/code/apache/airflow-pr-attempt50/airflow-ctl ruff format --check airflow-ctl/src/airflowctl/ctl/cli_config.py airflow-ctl/tests/airflow_ctl/ctl/test_cli_config.py

Real behavior proof

  • Behavior or issue addressed: airflowctl list parameters now preserve comma-separated item boundaries instead of splitting each value into characters.
  • Real environment tested: Airflow main at commit 38401f8704162b4dfcdc642cd15150677f0fd14b in an isolated worktree.
  • Exact steps or command run after this patch: The targeted test_cli_config.py suite was run with uv, followed by Ruff checks.
  • Evidence after fix: 46 targeted tests passed; Ruff reported all checks passed and formatting was unchanged.
  • Observed result after fix: _python_type_from_string("list")("dag1, dag2") returns ["dag1", "dag2"].
  • What was not tested: A live Airflow API server and an end-to-end authenticated airflowctl dags get-stats request were not run locally.

@potiuk
potiuk merged commit 093c1ca into apache:main Sep 7, 2026
97 checks passed
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Backport successfully created: airflow-ctl/v0-1-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
✅ airflow-ctl/v0-1-test PR Link

aws-airflow-bot pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Sep 7, 2026
…72454)

(cherry picked from commit 093c1ca)

Co-authored-by: auyua9 <[email protected]>
Co-authored-by: auyua9 <[email protected]>
regarmukesh3g pushed a commit to regarmukesh3g/airflow that referenced this pull request Sep 27, 2026
shahar1 added a commit that referenced this pull request Oct 30, 2026
shahar1 added a commit that referenced this pull request Nov 19, 2026
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.

2 participants