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


##########
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:
   I kept it to match _serialize_dag_capturing_errors just below, which also 
logs and records an import error, since operators often watch processor logs 
rather than the UI. Your question did show the import error was missing the 
traceback, so I've added it the same way, honouring 
dagbag_import_error_traceback_depth. Happy to drop the log if you prefer that.



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