Skip to content

Remove ignored --output flag from airflow pools set and delete - #72833

Merged
potiuk merged 1 commit into
apache:mainfrom
Eason09053360:remove-ignored-output-flag-from-pools-set-delete
Sep 9, 2026
Merged

potiuk merged 1 commit into
apache:mainfrom
Eason09053360:remove-ignored-output-flag-from-pools-set-delete

Conversation

@Eason09053360

@Eason09053360 Eason09053360 commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

airflow pools set and airflow pools delete advertise -o/--output in their help, but neither command reads the value. The flag is accepted and silently ignored:

$ airflow pools set foo 1 test -o json
Pool foo created
$ airflow pools delete foo -o yaml
Pool foo deleted

pools get -o json and pools list -o json honour the flag as expected; only set and delete do not.

Why the flag is there. Before #12704 both commands rendered the affected pool as a table via _tabulate_pools(..., tablefmt=args.output). That refactor replaced the rendering with a fixed confirmation message but left ARG_OUTPUT in the argument table. #13071 removed the same orphaned flag from pools import/export and missed set/delete, so the help has promised a format choice it cannot deliver ever since.

What this PR does. Drops ARG_OUTPUT from the pools set and pools delete definitions in cli_config.py. The command functions are untouched; they never used the value. After the change the pools group matches connections and variables, where only the read commands (list, get) take -o. The CLI reference page is generated from the argument table, so it updates on its own.

Behaviour change to be aware of. An invocation that passes -o/--output to these two commands now fails with argparse's unrecognized arguments error (exit code 2) instead of exiting 0 with the plain confirmation message. Invocations without the flag are unchanged. I have not added a newsfragment since the flag never had an effect; happy to add one if maintainers consider this user-facing.

Why not make the flag work instead. The airflowctl pools create/delete successors do render the affected pool with -o, and the core commands are already marked @deprecated_for_airflowctl pointing at them. Restoring table rendering here would change the default stdout of every pools set/pools delete call, a larger blast radius than removing a no-op flag from a deprecated surface. If maintainers prefer restoring the rendering, I can do that instead.

Testing. Added a parametrized parser test in test_cli_parser.py next to the other argparse-rejection tests, asserting exit code 2 and the unrecognized arguments: --output json message for both commands. With the fix reverted and only the test kept, exactly those two cases fail.

related: #12704, #13071


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

Both commands advertised -o/--output in their help but never read the
value: apache#12704 replaced the table rendering with a fixed confirmation
message and left ARG_OUTPUT in the argument table. apache#13071 removed the
same orphaned flag from pools import/export but missed set and delete,
so the help has promised a format choice it cannot deliver ever since.
Dropping the flag makes the help truthful and brings the pools group in
line with connections and variables, where only list and get take -o.
@potiuk
potiuk merged commit bdf2abc into apache:main Sep 9, 2026
73 checks passed
imrichardwu pushed a commit to imrichardwu/airflow that referenced this pull request Sep 11, 2026
…e#72833)

Both commands advertised -o/--output in their help but never read the
value: apache#12704 replaced the table rendering with a fixed confirmation
message and left ARG_OUTPUT in the argument table. apache#13071 removed the
same orphaned flag from pools import/export but missed set and delete,
so the help has promised a format choice it cannot deliver ever since.
Dropping the flag makes the help truthful and brings the pools group in
line with connections and variables, where only list and get take -o.

Co-authored-by: Eason09053360 <185830721+Eason09053360@users.noreply.github.com>
xvega pushed a commit to xvega/airflow that referenced this pull request Sep 13, 2026
…e#72833)

Both commands advertised -o/--output in their help but never read the
value: apache#12704 replaced the table rendering with a fixed confirmation
message and left ARG_OUTPUT in the argument table. apache#13071 removed the
same orphaned flag from pools import/export but missed set and delete,
so the help has promised a format choice it cannot deliver ever since.
Dropping the flag makes the help truthful and brings the pools group in
line with connections and variables, where only list and get take -o.

Co-authored-by: Eason09053360 <185830721+Eason09053360@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants