ashb commented on a change in pull request #9851:
URL: https://github.com/apache/airflow/pull/9851#discussion_r456324355



##########
File path: airflow/models/serialized_dag.py
##########
@@ -212,3 +228,18 @@ def bulk_sync_to_db(dags: List[DAG], session=None):
                     min_update_interval=MIN_SERIALIZED_DAG_UPDATE_INTERVAL,
                     session=session
                 )
+
+    @classmethod
+    @provide_session
+    def get_last_updated_date(cls, dag_id: str, session: Session = None) -> 
datetime:
+        """
+        Get the date when the Serialized DAG associated to DAG was last updated
+        in serialized_dag table
+
+        :param dag_id: DAG ID
+        :type dag_id: str
+        :param session: ORM Session
+        :type session: Session
+        """
+        result = session.query(cls.last_updated).filter(cls.dag_id == 
dag_id).one()
+        return result.last_updated

Review comment:
       ```suggestion
           return session.query(cls.last_updated).filter(cls.dag_id == 
dag_id).scalar()
   ```




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


Reply via email to