phanikumv commented on code in PR #32645:
URL: https://github.com/apache/airflow/pull/32645#discussion_r1269760734


##########
airflow/models/serialized_dag.py:
##########
@@ -379,7 +376,10 @@ def get_latest_version_hash_and_updated_datetime(
         :param session: ORM Session
         :return: A tuple of DAG Hash and last updated datetime, or None if the 
DAG is not found
         """
-        return session.query(cls.dag_hash, cls.last_updated).filter(cls.dag_id 
== dag_id).one_or_none()
+        try:
+            return session.execute(select(cls.dag_hash, 
cls.last_updated).where(cls.dag_id == dag_id)).one()
+        except NoResultFound:

Review Comment:
   used `one_or_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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to