ashb commented on code in PR #47339:
URL: https://github.com/apache/airflow/pull/47339#discussion_r1987133534


##########
airflow/api_fastapi/execution_api/routes/task_instances.py:
##########
@@ -186,18 +186,18 @@ def ti_run(
         if not dr:
             raise ValueError(f"DagRun with dag_id={ti.dag_id} and 
run_id={ti.run_id} not found.")
 
-        # Clear XCom data for the task instance since we are certain it is 
executing
+        # Send the XCom data for clearance for the task instance since we are 
certain it is executing at this point.
         # However, do not clear it for deferral
         if not ti.next_method:
             map_index = None if ti.map_index < 0 else ti.map_index
             log.info("Clearing xcom data for task id: %s", ti_id_str)
-            XCom.clear(
-                dag_id=ti.dag_id,
-                task_id=ti.task_id,
-                run_id=ti.run_id,
-                map_index=map_index,
-                session=session,
+            query = session.query(XComModel.key).filter_by(
+                dag_id=ti.dag_id, task_id=ti.task_id, run_id=ti.run_id
             )
+            if map_index is not None:
+                query = query.filter_by(map_index=map_index)

Review Comment:
   Is this not `XComModel.get_many()`?



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