fix(cli): stop interpreting table content as console markup - #3990
Open
ArulJerald wants to merge 1 commit into
Open
ArulJerald wants to merge 1 commit into
ArulJerald wants to merge 1 commit into
Conversation
The CLI passed table and view content straight to Rich as plain strings, so square-bracket sequences in a property key or value, a column name or doc, a ref name, an identifier or a path were parsed as style tags instead of text. Content therefore controlled the styling of the output, and unbalanced tags could alter how surrounding rows rendered. Disable markup on the consoles the CLI writes through, rather than escaping each call site, so every current and future render is covered. Closes apache#3984
ArulJerald
force-pushed
the
issue-3984-cli-rich-markup-escape
branch
from
September 17, 2026 07:51
d6962b7 to
202df52
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The CLI passed table and view content straight to Rich as plain strings, so square-bracket sequences in a property key or value, a column name or doc, a ref name, an identifier or a path were parsed as style tags rather than text. Content therefore controlled the styling of CLI output, and unbalanced or misleading tags could alter how surrounding rows rendered.
Closes #3984
Rationale for this change
The issue reports this for
describe_properties, and notes the same pattern in the otherdescribe_*methods. Escaping each call site individually would mean roughly twentyText(...)wraps, and would leave the next render added to the class exposed again.Disabling markup on the consoles the CLI writes through fixes every site at once — table cells, tree labels and printed exceptions alike — and keeps future renders covered by default. The three property maps are the sites named in the issue; column names and docs (
schema, and the schema tree indescribe), ref names, identifiers, partition specs and manifest/data-file paths were affected the same way and are now covered too.Are these changes tested?
Yes. Five tests in
tests/cli/test_console.pyassert that content containing[bold red]injected[/]reaches the output literally rather than being consumed as a style directive:describe --entity namespace)describe)describe --entity=view)schema)describe)All five fail without the change and pass with it. Full file: 106 passed.
Are there any user-facing changes?
Only that content containing square brackets now renders as written instead of being interpreted as styling. No command, flag or output structure changes.