kaxil commented on code in PR #54225:
URL: https://github.com/apache/airflow/pull/54225#discussion_r2286134581
##########
airflow-core/src/airflow/models/dagbag.py:
##########
@@ -549,10 +544,15 @@ def bag_dag(self, dag: DAG):
)
self.dags[dag.dag_id] = dag
self.log.debug("Loaded DAG %s", dag)
- except (AirflowDagCycleException, AirflowDagDuplicatedIdException):
- # There was an error in bagging the dag. Remove it from the list
of dags
+ except AirflowDagDuplicatedIdException:
self.log.exception("Exception bagging dag: %s", dag.dag_id)
raise
+ except Exception as e:
+ if type(e).__name__ == "AirflowDagCycleException":
+ self.log.exception("Cycle detected in DAG: %s", dag.dag_id)
Review Comment:
aah yes it is outside the `else` block, cool
##########
airflow-core/src/airflow/models/dagbag.py:
##########
@@ -549,10 +544,15 @@ def bag_dag(self, dag: DAG):
)
self.dags[dag.dag_id] = dag
self.log.debug("Loaded DAG %s", dag)
- except (AirflowDagCycleException, AirflowDagDuplicatedIdException):
- # There was an error in bagging the dag. Remove it from the list
of dags
+ except AirflowDagDuplicatedIdException:
self.log.exception("Exception bagging dag: %s", dag.dag_id)
raise
+ except Exception as e:
+ if type(e).__name__ == "AirflowDagCycleException":
+ self.log.exception("Cycle detected in DAG: %s", dag.dag_id)
Review Comment:
aah yes it is outside the `if..else` block, cool
--
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]