ashb commented on code in PR #47339:
URL: https://github.com/apache/airflow/pull/47339#discussion_r1987137943
##########
airflow/models/xcom.py:
##########
@@ -105,26 +99,54 @@ class BaseXCom(TaskInstanceDependencies, LoggingMixin):
dag_run = relationship(
"DagRun",
- primaryjoin="BaseXCom.dag_run_id == foreign(DagRun.id)",
+ primaryjoin="XComModel.dag_run_id == foreign(DagRun.id)",
uselist=False,
lazy="joined",
passive_deletes="all",
)
logical_date = association_proxy("dag_run", "logical_date")
- @reconstructor
- def init_on_load(self):
+ @classmethod
+ @provide_session
+ def clear(
+ cls,
+ *,
+ dag_id: str,
+ task_id: str,
+ run_id: str,
+ map_index: int | None = None,
+ session: Session = NEW_SESSION,
+ ) -> None:
"""
- Execute after the instance has been loaded from the DB or otherwise
reconstituted; called by the ORM.
+ Clear all XCom data from the database for the given task instance.
Review Comment:
```suggestion
Clear all XCom data from the database for the given task instance.
.. note:: This **will not** purge any data from a custom XCom
backend.
```
just to be explicit
--
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]