SameerMesiah97 commented on code in PR #76175:
URL: https://github.com/apache/airflow/pull/76175#discussion_r4433213016
##########
airflow-ctl/tests/airflow_ctl/ctl/test_console_formatting.py:
##########
@@ -162,3 +162,16 @@ def test_simple_table_add_column_smoke():
table.add_column("column_1")
assert table.columns[0].header == "column_1"
+
+
[email protected]("output", ["table", "plain"])
+def test_print_as_keeps_square_brackets_in_values(output):
+ """Values that look like Rich markup are shown as-is instead of being
dropped or raising."""
+ console = console_formatting.AirflowConsole(record=True)
+ values = ["s3://[bucket]/path", "[red]not styled[/red]", "a[0-9]+ [/b]"]
Review Comment:
Could we parametrize the values too, so each case runs separately? and could
we add cases for square brackets in headers and a backslash before a tag, e.g.
`r"path\[red]"`, to check these are preserved?
##########
airflow-ctl/src/airflowctl/ctl/console_formatting.py:
##########
Review Comment:
Could we also escape the headers in `table.add_column(col)`? They’re still
interpreted as Rich markup, so a key like `[red]name[/red]` would lose its
tags, and `[/b]` could raise `MarkupError`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]