uranusjr commented on code in PR #45339:
URL: https://github.com/apache/airflow/pull/45339#discussion_r1900598966


##########
airflow/models/dag.py:
##########
@@ -770,6 +770,18 @@ def get_is_paused(self, session=NEW_SESSION) -> None:
         """Return a boolean indicating whether this DAG is paused."""
         return session.scalar(select(DagModel.is_paused).where(DagModel.dag_id 
== self.dag_id))
 
+    @property
+    @provide_session
+    def bundle_name(self, session=NEW_SESSION) -> str:
+        """Return the name of the bundle this DAG is in."""
+        return 
session.scalar(select(DagModel.bundle_name).where(DagModel.dag_id == 
self.dag_id))

Review Comment:
   I don’t quite like this, it opens a new db connection to do one single db 
query for each property access. Too much hidden side effect for a simply 
attribute access IMO.



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