Skip to content

Escape Rich markup in airflow-core SimpleTable output - #76519

Open
Kaap10 wants to merge 2 commits into
apache:mainfrom
Kaap10:fix-airflow-core-simple-table-escape-markup
Open

Kaap10 wants to merge 2 commits into
apache:mainfrom
Kaap10:fix-airflow-core-simple-table-escape-markup

Conversation

@Kaap10

@Kaap10 Kaap10 commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

AirflowConsole.print_as_table and print_as_plain_table in airflow-core/src/airflow/cli/simple_table.py passed column headers and cell values to Rich without escaping. Consequently, values or column headers containing Rich closing tags such as [/b] crashed the CLI command with a MarkupError, and strings containing bracketed text such as s3://[bucket]/path or [tag] silently had their bracketed sections stripped.

This change escapes column headers and cell values with rich.markup.escape in print_as_table and renders literal plain text in print_as_plain_table with markup=False, matching the behavior established in airflowctl (PR #76175). Dedicated unit tests are added in airflow-core/tests/unit/cli/test_simple_table.py.


Was generative AI tooling used to co-author this PR?
  • Yes — Antigravity

Generated-by: Antigravity following the guidelines

AirflowConsole.print_as_table passed column headers and cell values to Rich without escaping. Consequently, values or column headers containing Rich closing tags such as [/b] crashed the CLI with a MarkupError, and strings containing bracketed text such as s3://[bucket]/path or [tag] silently had their bracketed sections stripped.

Escape headers and cell values with rich.markup.escape so they render literally as stored, matching the behavior in airflow-ctl.

@yuseok89 yuseok89 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I left one small suggestion.

@Kaap10

Kaap10 commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @yuseok89 for the suggestion! Applied, and all CI checks are now fully green.

This branch has not been deployed

No deployments
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