kacpermuda opened a new pull request, #75132: URL: https://github.com/apache/airflow/pull/75132
Listener consumers such as OpenLineage should be able to trace an event back to the task execution that produced it from what the listener gets, not by looking the attempt up by `ti.id` in the metadata database. For mapped tasks and task loops part of that wasn't exposed: - `TIRunContext.expanded_ti_count`: the number of live instances in the mapped task's expansion, counted within the iteration inside a loop. Without it a listener doesn't know how many events to expect, so it can't tell "3 of 20 instances failed" or that all of them finished. - `LoopContext.region_id`: the loop region holding the iteration. A mapped task's own `region_id` is its expansion's, so this is what ties it to the other tasks of the same pass. - `LoopContext.trajectory`, `forked_from_region_id` and `resumes_from_index`: which rerun of the loop an iteration ran in, and which execution it replaced from which iteration on. Before, ordering reruns meant comparing the UUIDv7 region ids of two events. - Public `RuntimeTaskInstance.loop`, `loop_decision` and `expanded_ti_count`. A gate's decision was only in the private `_loop_decision`, so its listener couldn't tell `until` being met from `max_iterations` being reached. - `get_task_instance_execution_position(ti, session=...)`, so listeners called on the API server (manual state changes) get the same data as the worker, instead of reading `dynamic_region` rows. The fields go into the unreleased `2026-10-30` Execution API version, so they can ship with 3.4.0. related: #74752 --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes (Claude Code) Generated-by: 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) --- * Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)** for more information. Note: commit author/co-author name and email in commits become permanently public when merged. * For fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed. * When adding dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x). * For significant user-facing changes create newsfragment: `{pr_number}.significant.rst`, in [airflow-core/newsfragments](https://github.com/apache/airflow/tree/main/airflow-core/newsfragments). You can add this file in a follow-up commit after the PR is created so you know the PR number. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
