jason810496 opened a new pull request, #76893:
URL: https://github.com/apache/airflow/pull/76893
- **next**: #75392
## Why
A mapped TS task reading or writing another task's XCom sent its own map
index, so it missed the unmapped row. A wrongly typed key, id or `mapIndex`
made the supervisor drop the request without replying, so the task hung until
its execution timeout.
## What
- `getXCom` and `setXCom` use the running task's map index only when the
target is the running task itself. For any other task, Dag or run, the default
is the unmapped XCom.
- They throw `TypeError` or `RangeError` for an invalid `key`, `dagId`,
`taskId`, `runId` or `mapIndex` before anything is sent.
```ts
// In a mapped task with map index 3, reading an unmapped upstream:
await client.getXCom({ key: "path", taskId: "extract" });
// before: read extract[3] and returned null
// after: reads the unmapped extract XCom
await client.getXCom({ key: "path", mapIndex: 1.5 });
// before: hung until the execution timeout
// after: rejects with RangeError
```
---
##### Was generative AI tooling used to co-author this PR?
- [x] Yes, with help of Claude Code Opus 5.5 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]