o-nikolas commented on code in PR #55973:
URL: https://github.com/apache/airflow/pull/55973#discussion_r2376302449


##########
airflow-core/src/airflow/models/dagbag.py:
##########
@@ -147,12 +147,44 @@ def handle_timeout(signum, frame):
 
 
 def _validate_executor_fields(dag: DAG) -> None:
+    """Validate that executors specified in tasks are available and owned by 
the same team as the dag bundle."""
+    import logging
+
+    log = logging.getLogger(__name__)
+    dag_team_name = None
+
+    # Get team name from bundle configuration if available
+    if hasattr(dag, "bundle_name") and dag.bundle_name:
+        try:
+            from airflow.dag_processing.bundles.manager import 
DagBundlesManager
+
+            bundle_manager = DagBundlesManager()
+            bundle_config = bundle_manager._bundle_config[dag.bundle_name]
+            # TODO[multi-team] Raise exceptions below instead of logging once 
we have a multi-team feature flag configuration
+            dag_team_name = bundle_config.team_name
+            log.debug(
+                "Found team '%s' for DAG '%s' via bundle '%s'", dag_team_name, 
dag.dag_id, dag.bundle_name
+            )
+        except Exception as e:
+            log.debug(

Review Comment:
   Yupp, see the ToDo above. For now I do not want this code to fail the dag 
parsing in ANY possible way, so all exceptions are caught and logged. As we 
test, tweak and gain comfort with this approach this debug statement will be 
changed to an exception being raised (or the try/catch removed and the 
exceptions allowed to bubble up). 



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