abhishekbhakat commented on code in PR #58111:
URL: https://github.com/apache/airflow/pull/58111#discussion_r2533516584


##########
airflow-core/src/airflow/jobs/scheduler_job_runner.py:
##########
@@ -1599,6 +1591,19 @@ def _mark_backfills_complete(self, session: Session = 
NEW_SESSION) -> None:
         for b in backfills:
             b.completed_at = now
 
+    def _get_current_dag(self, dag_model: DagModel, purpose: str, session: 
Session) -> SerializedDAG | None:
+        """Get current DAG for a dag_model, logging errors if loading fails."""
+        try:
+            serdag = SerializedDagModel.get(dag_id=dag_model.dag_id, 
session=session)
+            if not serdag:
+                return None
+            serdag.load_op_links = False
+            return serdag.dag
+        except Exception as e:
+            self.log.exception(e)
+            self.log.error("Failed to load DAG '%s' for %s", dag_model.dag_id, 
purpose)

Review Comment:
   Then raising the broad exception won't be help identify why it failed.
   
   Ref: https://github.com/apache/airflow/pull/54775#discussion_r2315308480



-- 
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]

Reply via email to