amoghrajesh commented on code in PR #54225:
URL: https://github.com/apache/airflow/pull/54225#discussion_r2286071783
##########
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:
But figured that this will be done as part of larger effort while moving
dagbag to sdk. So I will undo most changes in this PR but only move the tests
to sdk
##########
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:
There's a raise on line 555 which would do it
--
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]