Skip to content

Show square brackets in airflowctl table and plain output as typed - #76175

Merged
potiuk merged 3 commits into
apache:mainfrom
Rishabh00b:escape-rich-markup-in-airflowctl-table-output
Nov 1, 2026
Merged

potiuk merged 3 commits into
apache:mainfrom
Rishabh00b:escape-rich-markup-in-airflowctl-table-output

Conversation

@Rishabh00b

@Rishabh00b Rishabh00b commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

airflowctl ... --output table and --output plain passed values to Rich as markup, so a value such as [/b] crashed the command with a MarkupError and a value such as s3://[bucket]/path silently printed as s3:///path. Render the values literally, as --output json and --output yaml already do.

Two new tests in test_console_formatting.py fail without this change and pass with it. The full airflow-ctl test suite passes locally.


`airflowctl ... --output table` and `--output plain` passed values to Rich
as markup, so a value such as `[/b]` crashed the command with a
MarkupError and a value such as `s3://[bucket]/path` silently lost its
bracketed part. Render the values literally, as `--output json` and
`--output yaml` already do.
Column headers were still passed to Rich as markup, so a key such as
`[/b]` raised a MarkupError and `[red]name[/red]` lost its tags in
`--output table`. Escape them like the cell values, and run the output
tests once per value, including a backslash before a tag.
@shahar1

shahar1 commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Merged from main to include the CI fix

@potiuk potiuk 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 — escape for the Rich table and markup=False for the already-formatted plain output is the right split, and the tests cover the crash ([/b]) and the silent loss (s3://[bucket]/path) in both values and headers.


This review was drafted by an AI-assisted tool and
confirmed by an Apache Airflow maintainer. The maintainer
approving this PR has read the findings and signed off. If
something feels off, please reply on the PR and a maintainer
will follow up.

More on how Apache Airflow handles maintainer review:
Contributing guide.

@potiuk
potiuk enabled auto-merge (squash) November 1, 2026 09:13
@potiuk
potiuk merged commit 117f115 into apache:main Nov 1, 2026
91 checks passed
@github-actions

github-actions Bot commented Nov 1, 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

shahar1 added a commit that referenced this pull request Nov 1, 2026
…plain output as typed (#76175) (#76205)

* Show square brackets in airflowctl table and plain output as typed

`airflowctl ... --output table` and `--output plain` passed values to Rich
as markup, so a value such as `[/b]` crashed the command with a
MarkupError and a value such as `s3://[bucket]/path` silently lost its
bracketed part. Render the values literally, as `--output json` and
`--output yaml` already do.

* Show square brackets in airflowctl table headers as typed

Column headers were still passed to Rich as markup, so a key such as
`[/b]` raised a MarkupError and `[red]name[/red]` lost its tags in
`--output table`. Escape them like the cell values, and run the output
tests once per value, including a backslash before a tag.

---------
(cherry picked from commit 117f115)

Co-authored-by: Rishabh <[email protected]>
Co-authored-by: Shahar Epstein <[email protected]>
@Rishabh00b
Rishabh00b deleted the escape-rich-markup-in-airflowctl-table-output branch November 1, 2026 14:24
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.

4 participants