jason810496 opened a new pull request, #75392:
URL: https://github.com/apache/airflow/pull/75392

   The TypeScript 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 TypeScript equivalent.
   
   ```ts
   import { getClient } from "apache-airflow-ts-sdk";
   
   // Delete the running task's own XCom.
   await getClient().deleteXCom({ key: "staging_path" });
   
   // Target fields default to the current task's context, and can be 
overridden.
   await getClient().deleteXCom({ key: "staging_path", taskId: "extract" });
   ```
   
   `deleteXCom` takes the same target fields as `setXCom`, because the 
Execution API resolves the producer the same way for both: a task can delete 
whatever it can write. The call resolves whether or not anything was deleted, 
so a resolved promise is not proof that an XCom was removed.
   
   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.
   
   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]

Reply via email to