Leondon9 opened a new pull request, #62626:
URL: https://github.com/apache/airflow/pull/62626
Validate `map_index` range when creating task instances via CLI commands
(`tasks render`, `tasks test`, etc.) to provide a clear error instead of
silently proceeding with an invalid index.
**Changes:**
- In `_get_ti()`, call `task.get_parse_time_mapped_ti_count()` to check
that `map_index` is within `[0, count)` when a non-negative index is
supplied.
- For dynamically mapped tasks (XCom-based), catch `NotFullyPopulated`
/ `NotMapped` and skip validation since the count is not available at
parse time.
- Add 3 tests: out-of-range error, boundary success, dynamic mapping
skip.
closes: #60463
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes — Claude Code (Opus 4.6)
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]