meel-ayush commented on code in PR #76556:
URL: https://github.com/apache/airflow/pull/76556#discussion_r4490341421
##########
airflow-core/src/airflow/dag_processing/collection.py:
##########
@@ -599,6 +599,52 @@ def _reject_dags_with_unloadable_timetables(
return accepted
+def _reject_cross_bundle_dag_id_collisions(
+ bundle_name: str,
+ dags: Collection[LazyDeserializedDAG],
+ import_errors: dict[tuple[str, str], str],
+ *,
+ session: Session,
+) -> list[LazyDeserializedDAG]:
+ """Drop Dags whose dag_id is already registered in another active bundle,
recording an import error."""
+ if bundle_name == "dag_maker":
+ return list(dags)
+
+ dag_ids = {dag.dag_id for dag in dags}
+ if not dag_ids:
+ return list(dags)
+
+ stmt = select(DagModel.dag_id, DagModel.bundle_name,
DagModel.relative_fileloc).where(
+ DagModel.dag_id.in_(dag_ids),
+ DagModel.bundle_name != bundle_name,
+ DagModel.bundle_name != "dag_maker",
Review Comment:
Done, removed here too.
--
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]