Prab-27 commented on code in PR #47275:
URL: https://github.com/apache/airflow/pull/47275#discussion_r1995662651


##########
airflow/models/xcom.py:
##########
@@ -426,11 +428,13 @@ def clear(
         if not run_id:
             raise ValueError(f"run_id must be passed. Passed run_id={run_id}")
 
-        query = session.query(BaseXCom).filter_by(dag_id=dag_id, 
task_id=task_id, run_id=run_id)
+        query = select(BaseXCom).where(
+            BaseXCom.dag_id == dag_id, BaseXCom.task_id == task_id, 
BaseXCom.run_id == run_id
+        )
         if map_index is not None:
-            query = query.filter_by(map_index=map_index)
+            query = query.where(BaseXCom.map_index == map_index)
 
-        for xcom in query:
+        for xcom in session.execute(query).all():

Review Comment:
   I am not sure if this works fine for `session.delete(xcom).` 
   
   Could you please clarify when you get some free time?



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