ashb commented on a change in pull request #5372: [AIRFLOW-3057] add 
prev_*_date_success to template context
URL: https://github.com/apache/airflow/pull/5372#discussion_r291255707
 
 

 ##########
 File path: airflow/models/dagrun.py
 ##########
 @@ -218,12 +219,19 @@ def get_dag(self):
         return self.dag
 
     @provide_session
-    def get_previous_dagrun(self, session=None):
+    def get_previous_dagrun(self, session: Session = None, state: str = None) 
-> Optional['DagRun']:
         """The previous DagRun, if there is one"""
 
-        return session.query(DagRun).filter(
+        assert isinstance(session, Session)  # mypy
 
 Review comment:
   Add typing as we edit bits, but don't change the pattern we use for 
`session=None`

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to