This is an automated email from the ASF dual-hosted git repository.
jscheffl pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new d2c4c120984 fix mypy failure due to termcolor upgrade (#44313)
d2c4c120984 is described below
commit d2c4c120984223cf8e855a75ac5ee03082d63aca
Author: Kalyan R <[email protected]>
AuthorDate: Sun Nov 24 00:51:53 2024 +0530
fix mypy failure due to termcolor upgrade (#44313)
* add type to Color
* fix
---
airflow/cli/commands/standalone_command.py | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/airflow/cli/commands/standalone_command.py
b/airflow/cli/commands/standalone_command.py
index 0f8d45eb5f1..f248990a3dd 100644
--- a/airflow/cli/commands/standalone_command.py
+++ b/airflow/cli/commands/standalone_command.py
@@ -37,6 +37,8 @@ from airflow.utils import db
from airflow.utils.providers_configuration_loader import
providers_configuration_loaded
if TYPE_CHECKING:
+ from termcolor.termcolor import Color
+
from airflow.jobs.base_job_runner import BaseJobRunner
@@ -141,14 +143,14 @@ class StandaloneCommand:
You can pass multiple lines to output if you wish; it will be split
for you.
"""
- color = {
+ color: dict[str, Color] = {
"fastapi-api": "magenta",
"webserver": "green",
"scheduler": "blue",
"triggerer": "cyan",
"standalone": "white",
- }.get(name, "white")
- colorised_name = colored(f"{name:10}", color)
+ }
+ colorised_name = colored(f"{name:10}", color.get(name, "white"))
for line in output.splitlines():
print(f"{colorised_name} | {line.strip()}")