aneesh-joseph commented on a change in pull request #9973: URL: https://github.com/apache/airflow/pull/9973#discussion_r630008838
########## File path: airflow/models/serialized_dag.py ########## @@ -114,14 +114,17 @@ def write_dag(cls, dag: DAG, min_update_interval: Optional[int] = None, session: # If Yes, does nothing # If No or the DAG does not exists, updates / writes Serialized DAG to DB if min_update_interval is not None: - if session.query( - exists().where( + if ( + session.query(literal(True)) + .filter( and_( cls.dag_id == dag.dag_id, (timezone.utcnow() - timedelta(seconds=min_update_interval)) < cls.last_updated, ) ) - ).scalar(): + .first() + is not None Review comment: done -- 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: us...@infra.apache.org