ashb commented on code in PR #74709:
URL: https://github.com/apache/airflow/pull/74709#discussion_r4270275641


##########
airflow-core/src/airflow/dag_processing/collection.py:
##########
@@ -573,6 +573,31 @@ def _reject_other_teams_plugin_classes(
     return accepted
 
 
+def _reject_dags_with_unloadable_timetables(
+    bundle_name: str,
+    dags: Collection[LazyDeserializedDAG],
+    import_errors: dict[tuple[str, str], str],
+) -> list[LazyDeserializedDAG]:
+    """
+    Drop Dags whose timetable raises when rebuilt, recording an import error 
for each.
+
+    A custom timetable runs user code when it is deserialized, for example 
``Variable.get`` in
+    ``__init__``. Checking here keeps one failing Dag from aborting the save 
of every Dag in its file.
+    """
+    accepted: list[LazyDeserializedDAG] = []
+    for dag in dags:
+        try:
+            dag.timetable
+        except Exception as e:
+            log.exception("Failed to load timetable of Dag", dag_id=dag.dag_id)

Review Comment:
   Do we need to log it here if the error is already visible in the UI?



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