Skip to content

Fix airflowctl pools export ignoring --output table/yaml/plain#62665

Merged
bugraoz93 merged 4 commits into
apache:mainfrom
Leondon9:fix/62651-pool-export-output-format
Mar 3, 2026
Merged

Fix airflowctl pools export ignoring --output table/yaml/plain#62665
bugraoz93 merged 4 commits into
apache:mainfrom
Leondon9:fix/62651-pool-export-output-format

Conversation

@Leondon9
Copy link
Copy Markdown
Contributor

@Leondon9 Leondon9 commented Mar 1, 2026

airflowctl pools export accepts --output table|yaml|plain but only handles json properly. For all other formats, it falls through to rich.print(pools_list) which outputs raw Python list repr instead of formatted output.

This replaces the raw rich.print() call with AirflowConsole().print_as(), which already supports all 4 output formats and is used by other airflow-ctl commands.

closes: #62651


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (claude-opus-4-6)

Generated-by: Claude Code (claude-opus-4-6) following the guidelines

The export command was using `rich.print()` for non-JSON output formats,
which printed raw Python repr instead of respecting the user's --output
format choice. Use `AirflowConsole().print_as()` to properly format
output as table, yaml, or plain text.

Co-Authored-By: claude-flow <ruv@ruv.net>
@henry3260
Copy link
Copy Markdown
Contributor

Thanks for the PR! Could you add a corresponding tests for this?

@Leondon9 Leondon9 force-pushed the fix/62651-pool-export-output-format branch from e091745 to 47fc0e1 Compare March 1, 2026 12:38
Leondon9 and others added 2 commits March 2, 2026 02:40
…trize

- assert_called_once_with() to verify both pool data and output format
- Parametrize over table/yaml/plain to cover all non-JSON formats

Co-Authored-By: claude-flow <ruv@ruv.net>
@Leondon9
Copy link
Copy Markdown
Contributor Author

Leondon9 commented Mar 2, 2026

Thanks for the PR! Could you add a corresponding tests for this?

I've added the corresponding tests for non-JSON outputs in the latest commits.
PTAL!

Copy link
Copy Markdown
Contributor

@bugraoz93 bugraoz93 left a comment

Choose a reason for hiding this comment

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

Nice, thanks!

@bugraoz93 bugraoz93 merged commit 9dc4e5d into apache:main Mar 3, 2026
82 checks passed
dominikhei pushed a commit to dominikhei/airflow that referenced this pull request Mar 11, 2026
…che#62665)

* Fix `airflowctl pools export` ignoring --output table/yaml/plain

The export command was using `rich.print()` for non-JSON output formats,
which printed raw Python repr instead of respecting the user's --output
format choice. Use `AirflowConsole().print_as()` to properly format
output as table, yaml, or plain text.

Co-Authored-By: claude-flow <ruv@ruv.net>

* Add test verifying non-JSON pool export delegates to AirflowConsole

Co-Authored-By: claude-flow <ruv@ruv.net>

* Strengthen non-JSON export test with argument verification and parametrize

- assert_called_once_with() to verify both pool data and output format
- Parametrize over table/yaml/plain to cover all non-JSON formats

Co-Authored-By: claude-flow <ruv@ruv.net>

* Use keyword args for print_as to match other airflow-ctl commands

Co-Authored-By: claude-flow <ruv@ruv.net>

---------

Co-authored-by: claude-flow <ruv@ruv.net>
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.

airflowctl pools export ignores --output table/yaml/plain, prints raw Python repr

3 participants