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


##########
airflow/models/dagbundle.py:
##########
@@ -41,3 +47,8 @@ class DagBundleModel(Base):
 
     def __init__(self, *, name: str):
         self.name = name
+
+    @staticmethod
+    @provide_session
+    def get(name: str, session: Session = NEW_SESSION) -> DagBundleModel:
+        return session.query(DagBundleModel).get(name)

Review Comment:
   ```suggestion
       @classmethod
       @provide_session
       def get(cls, name: str, session: Session = NEW_SESSION) -> 
DagBundleModel:
           return session.get(cls, name)
   ```
   
   Is this function useful? It looks like the only advantage is we don’t need 
to create a session explicitly. But I only see this function used once, in 
which case just calling `create_session` when needed is actually less code…



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