jason810496 opened a new pull request, #75393:
URL: https://github.com/apache/airflow/pull/75393
The Java Task SDK can read and write XComs but not delete them. Python task
code has had a public delete since the Task SDK landed, through
`BaseXCom.delete`. This adds the Java equivalent.
```java
// Delete the running task's return-value XCom.
client.deleteXCom();
// Or a specific key.
client.deleteXCom("staging_path");
```
`deleteXCom` deletes only the running task's own XCom, mirroring `setXCom`,
which is also pinned to the current task instance. It returns normally when no
XCom is stored under the key.
No protocol or core change is needed. The `DeleteXCom` frame and its
supervisor routing already exist, and are already used to clear a task
instance's XComs when it starts again.
To do after rebase: add `deleteXCom` to the client method table in
`airflow-core/docs/authoring-and-scheduling/language-sdks/java.rst`. That page
is being rewritten separately and is expected to land first, so this PR leaves
it untouched.
Known gap, not addressed here: the supervisor deletes the row without
calling the XCom backend's `purge`, so a delete against a custom backend leaves
the stored object behind. #75184 closes that for all language SDKs.
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes (please specify the tool below)
Generated-by: Claude Code following [the
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
--
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]