justinpakzad commented on code in PR #59874:
URL: https://github.com/apache/airflow/pull/59874#discussion_r2676629371


##########
airflow-core/src/airflow/api_fastapi/execution_api/routes/xcoms.py:
##########
@@ -413,26 +417,40 @@ def set_xcom(
 
 
 @router.delete(
-    "/{dag_id}/{run_id}/{task_id}/{key:path}",
+    "/{dag_id}/{run_id}",
     responses={status.HTTP_404_NOT_FOUND: {"description": "XCom not found"}},
-    description="Delete a single XCom Value",
+    description="Delete XCom Value(s).",
 )
 def delete_xcom(
     session: SessionDep,
     dag_id: str,
     run_id: str,
-    task_id: str,
-    key: Annotated[str, Path(min_length=1)],
+    task_id: Annotated[str | None, Query()] = None,
+    key: Annotated[str | None, Query()] = None,
     map_index: Annotated[int, Query()] = -1,
 ):
-    """Delete a single XCom Value."""
+    """
+    Delete XCom entry(ies).
+
+    Supports bulk deletion when task_id and/or key are not provided.
+    """

Review Comment:
   Got it, that makes sense. Maybe I was being a bit naive and didn't consider 
some of the potential dangers here. Happy to create the separate endpoint. The 
only thing I'm still uncertain about is, if we create a new endpoint, but still 
just use `XComOperations.delete()` and determine which endpoint to use (bulk or 
single) based on the parameters passed, does that actually address the safety 
concern you have? I think we might need to have a 
`XComOperations.bulk_delete()` method that explicitly calls the bulk endpoint, 
thus preventing  any accidental bulk operations. Curious to hear what you think.



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