dstandish commented on code in PR #31175:
URL: https://github.com/apache/airflow/pull/31175#discussion_r1190237400
##########
airflow/executors/kubernetes_executor.py:
##########
@@ -820,9 +821,11 @@ def get_task_log(self, ti: TaskInstance, try_number: int)
-> tuple[list[str], li
tail_lines=100,
_preload_content=False,
)
-
+ ansi_escape = re.compile(r"\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])")
Review Comment:
i agree... but i thought that the variable name was sufficient:
`ansi_escape`
wdyt?
there's a more verbose form:
```
import re
# 7-bit C1 ANSI sequences
ansi_escape = re.compile(r'''
\x1B # ESC
(?: # 7-bit C1 Fe (except CSI)
[@-Z\\-_]
| # or [ for CSI, followed by a control sequence
\[
[0-?]* # Parameter bytes
[ -/]* # Intermediate bytes
[@-~] # Final byte
)
''', re.VERBOSE)
```
All blatantly stolen from stack overflow
https://stackoverflow.com/a/14693789/2761682
--
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]