dstandish commented on code in PR #26682:
URL: https://github.com/apache/airflow/pull/26682#discussion_r981496197
##########
airflow/utils/cli.py:
##########
@@ -187,9 +187,12 @@ def get_dag(subdir: str | None, dag_id: str) -> DAG:
dagbag = DagBag(process_subdir(subdir))
if dag_id not in dagbag.dags:
- raise AirflowException(
- f"Dag {dag_id!r} could not be found; either it does not exist or
it failed to parse."
- )
+ if dagbag.import_errors:
+ details = "it failed to parse"
+ else:
+ details = "it does not exist"
Review Comment:
I'm not sure this is a valid inference.
I think it is possible that the `import_errors` are from other dags in the
dags folder, and the file for the dag still does not exist.
--
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]