ashb commented on a change in pull request #17405:
URL: https://github.com/apache/airflow/pull/17405#discussion_r682512524



##########
File path: airflow/models/taskinstance.py
##########
@@ -656,11 +656,12 @@ def clear_xcom_data(self, session=None):
         :type session: Session
         """
         self.log.debug("Clearing XCom data")
-        session.query(XCom).filter(
-            XCom.dag_id == self.dag_id,
-            XCom.task_id == self.task_id,
-            XCom.execution_date == self.execution_date,
-        ).delete()
+        XCom.clear(
+            dag_id=self.dag_id,
+            task_id=self.task_id,
+            execution_date=self.execution_date,
+            session=session,
+        )
         session.commit()

Review comment:
       ```suggestion
   ```
   
   While we are here, lets fix up this too.




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