Skip to content

Fix airflow dags list --columns help showing wrong default columns - #72607

Merged
dheerajturaga merged 1 commit into
apache:mainfrom
Eason09053360:fix-dags-list-columns-help-default
Sep 7, 2026
Merged

dheerajturaga merged 1 commit into
apache:mainfrom
Eason09053360:fix-dags-list-columns-help-default

Conversation

@Eason09053360

Copy link
Copy Markdown
Contributor

The --columns help for airflow dags list said the default was ['dag_id', 'fileloc', 'owner', 'is_paused'], but the actual default has been ('dag_id', 'fileloc', 'owners', 'is_paused', 'bundle_name', 'bundle_version') since #45779, and the valid field name has always been owners (the help said owner since the option was introduced in #35250).

Following the help literally (--columns owner) prints an "Ignoring the following invalid columns" error and drops the column from the table. The generated CLI reference docs (cli-and-env-variables-ref.rst, built via .. argparse::) carried the same wrong text.

This PR derives the help string from the same tuple used as default, so the two cannot drift apart again, and adds a parametrized test that asserts the (default: [...]) fragment in the help of both --columns arguments (dags list, assets list) matches their actual default.

Rendered help after the change:

--columns COLUMNS     List of columns to render. (default: ['dag_id', 'fileloc', 'owners', 'is_paused', 'bundle_name', 'bundle_version'])

Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Fable 5.1)

Generated-by: Claude Code (Fable 5.1) following the guidelines

The help text listed four default columns and named one of them
"owner", while the actual default renders six columns and the valid
field is "owners". Following the help therefore produced an "invalid
columns" error and a table missing the owners column, and the generated
CLI reference documentation carried the same mistake.

Derive the help text from the same tuple used as the default so the
two cannot drift apart again, and guard both --columns arguments with a
test.

@dheerajturaga dheerajturaga left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for catching this!

@dheerajturaga
dheerajturaga merged commit 72d42ae into apache:main Sep 7, 2026
73 checks passed
regarmukesh3g pushed a commit to regarmukesh3g/airflow that referenced this pull request Sep 27, 2026
…pache#72607)

The help text listed four default columns and named one of them
"owner", while the actual default renders six columns and the valid
field is "owners". Following the help therefore produced an "invalid
columns" error and a table missing the owners column, and the generated
CLI reference documentation carried the same mistake.

Derive the help text from the same tuple used as the default so the
two cannot drift apart again, and guard both --columns arguments with a
test.

Co-authored-by: Eason09053360 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants