Repository navigation
fix(cli): stop interpreting table content as console markup - #3990
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
d6962b7 to
202df52
Compare
|
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that's incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the [email protected] list. Thank you for your contributions. |
|
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that's incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the [email protected] list. Thank you for your contributions. |
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.