uranusjr commented on code in PR #59874:
URL: https://github.com/apache/airflow/pull/59874#discussion_r3793847994
##########
task-sdk/src/airflow/sdk/bases/xcom.py:
##########
@@ -572,3 +574,42 @@ def delete(
map_index=map_index,
),
)
+
+ @classmethod
+ def delete_all(
+ cls,
+ dag_id: str,
+ run_id: str,
+ task_id: str | None = None,
+ key: str | None = None,
+ map_index: int | None = None,
+ ) -> int:
+ """
+ Bulk delete XCom entries, optionally filtered by task_id, key, or
map_index.
+
+ :param dag_id: Dag ID.
+ :param run_id: Dag run ID for the task.
+ :param task_id: Optional task ID filter. If provided, only XComs from
this task
+ will be deleted. Pass *None* (default) to delete across all tasks.
+ :param key: Optional key filter. If provided, only XComs with this key
+ will be deleted. Pass *None* (default) to delete all keys.
+ :param map_index: Optional map index filter. If provided, only XComs
with this
+ map index will be deleted. Pass *None* (default) to delete all map
indexes.
+ :return: Number of XCom entries deleted.
+ """
+ from airflow.sdk.execution_time.task_runner import SUPERVISOR_COMMS
+
+ msg = SUPERVISOR_COMMS.send(
Review Comment:
Is there not a way to actually call purge? Simply giving up with a note
seems wrong to me.
--
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]