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


##########
airflow/www/views.py:
##########
@@ -2293,15 +2300,17 @@ def clear(self, *, session: Session = NEW_SESSION):
 
             # Lock the related dag runs to prevent from possible dead lock.
             # https://github.com/apache/airflow/pull/26658
-            dag_runs_query = session.query(DagRun.id).filter(DagRun.dag_id == 
dag_id).with_for_update()
+            dag_runs_query = session.scalars(
+                select(DagRun.id).where(DagRun.dag_id == 
dag_id).with_for_update()
+            )
             if start_date is None and end_date is None:
-                dag_runs_query = dag_runs_query.filter(DagRun.execution_date 
== start_date)
+                dag_runs_query = dag_runs_query.where(DagRun.execution_date == 
start_date)
             else:
                 if start_date is not None:
-                    dag_runs_query = 
dag_runs_query.filter(DagRun.execution_date >= start_date)
+                    dag_runs_query = 
dag_runs_query.where(DagRun.execution_date >= start_date)

Review Comment:
   Fixed in #32801 



-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to