vincbeck commented on code in PR #70312:
URL: https://github.com/apache/airflow/pull/70312#discussion_r3685938927


##########
airflow-core/src/airflow/models/dag.py:
##########
@@ -482,6 +482,15 @@ class DagModel(Base):
     dag_versions = relationship(
         "DagVersion", back_populates="dag_model", cascade="all, delete, 
delete-orphan"
     )
+    # The Dag's bundle, which carries the owning team. ``lazy="raise"`` 
forbids implicit
+    # loading so a caller that forgets ``eager_load_teams`` cannot emit a 
silent N+1;
+    # ``TeamOwnedMixin.team_name`` only reads this once loader options have 
populated it.
+    bundle = relationship(
+        "DagBundleModel",
+        primaryjoin="DagModel.bundle_name == DagBundleModel.name",
+        viewonly=True,
+        lazy="raise",
+    )

Review Comment:
   `primaryjoin="DagModel.bundle_name == DagBundleModel.name",` was not needed 
but the relationship is needed



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