jedcunningham commented on a change in pull request #21991:
URL: https://github.com/apache/airflow/pull/21991#discussion_r819718094
##########
File path: airflow/cli/commands/dag_command.py
##########
@@ -315,6 +315,12 @@ def dag_next_execution(args):
def dag_list_dags(args):
"""Displays dags with or without stats at the command line"""
dagbag = DagBag(process_subdir(args.subdir))
+ if dagbag.import_errors:
+ from rich import print as rich_print
+
+ rich_print("[red][bold]Error:[bold] The following dags failed to load
[red]")
Review comment:
```suggestion
rich_print("[red][bold]Error:[/bold] The following dags failed to
load")
```
##########
File path: airflow/cli/commands/dag_command.py
##########
@@ -315,6 +315,12 @@ def dag_next_execution(args):
def dag_list_dags(args):
"""Displays dags with or without stats at the command line"""
dagbag = DagBag(process_subdir(args.subdir))
+ if dagbag.import_errors:
+ from rich import print as rich_print
+
+ rich_print("[red][bold]Error:[bold] The following dags failed to load
[red]")
+ for filename, stacktrace in dagbag.import_errors.items():
+ rich_print(f"[red][bold]Broken DAG: {filename}:
{stacktrace}[bold][red]")
Review comment:
```suggestion
rich_print(f"[red][bold]Broken DAG {filename}:[/bold]
{stacktrace}")
```
Not sure we even need to bold the filename?
--
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]