Skip to content

fix(cli): stop interpreting table content as console markup - #3990

Open
ArulJerald wants to merge 1 commit into
apache:mainfrom
ArulJerald:issue-3984-cli-rich-markup-escape
Open

ArulJerald wants to merge 1 commit into
apache:mainfrom
ArulJerald:issue-3984-cli-rich-markup-escape

Conversation

@ArulJerald

Copy link
Copy Markdown

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 other describe_* methods. Escaping each call site individually would mean roughly twenty Text(...) 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 in describe), 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.py assert that content containing [bold red]injected[/] reaches the output literally rather than being consumed as a style directive:

  • namespace property (describe --entity namespace)
  • table property (describe)
  • view property (describe --entity=view)
  • column name and doc (schema)
  • column name in the schema tree (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.

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
ArulJerald force-pushed the issue-3984-cli-rich-markup-escape branch from d6962b7 to 202df52 Compare September 17, 2026 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI renders table property keys and values as Rich markup without escaping

1 participant