Repository navigation
[v3-4-test] Number task loop iterations from one instead of zero (#74773) - #75260
Merged
ashb merged 1 commit intoOct 21, 2026
Merged
Conversation
…che#74773) A loop iteration is a number people read: it shows up in the loop filter, on the Gantt tooltip, in the task instance list and in the `loop.index` a Dag author branches on. Starting it at zero meant each of those readers had to translate between the number Airflow stored and the number a person would say, and that translation was easy to apply in one place and forget in another. Numbering from one in storage removes the translation instead of hiding it behind a display-time adjustment, so the stored index, the API field and the UI agree without anyone adding to it. Mapped expansion indexes share the column and stay zero-based: a map index is a position, not a count, so code reading the column has to know whether the region executes a loop or an expansion. Task loops have not shipped in a release, so no stored run and no client depends on the old numbering, and the execution API version that introduces the loop context is still unreleased. Co-Authored-By: Claude <noreply@anthropic.com>
bbovenzi
requested review from
Lee-W,
XD-DENG,
amoghrajesh,
ashb,
bugraoz93,
choo121600,
dheerajturaga,
ephraimbuddy,
gopidesupavan,
guan404ming,
henry3260,
jason810496,
kaxil,
pierrejeambrun,
potiuk,
rawwar,
ryanahamilton,
shubhamraj-git and
vatsrahul1001
as code owners
October 21, 2026 02:59
Lee-W
approved these changes
Oct 21, 2026
1 task done
Contributor
|
Hi maintainer, this PR was merged without a milestone set.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #74773 to
v3-4-test, so 3.4.0 ships loop iterations numbered from one.Task loops are new in 3.4 and have not shipped in a release, so no stored run and no client depends on the old zero-based numbering. Leaving
v3-4-teston zero would release the confusing numbering that #74773 removes, and force a breaking change later.Merge after #74773 lands on main. The cherry-pick trailer is intentionally omitted: the squash-merge commit does not exist yet, and a trailer naming the branch commit would be a dead reference in the permanent history. It can be added when #74773 merges.
Differences from the commit on main
One hunk was dropped.
airflow-core/tests/unit/api_fastapi/execution_api/versions/head/test_xcoms.pyon main containstest_parsing_attempt_id_does_not_select_a_loop_iteration, which comes from an unrelated PR that is not onv3-4-test. The twosteps[0]→steps[1]edits inside it are therefore absent here. Nothing else differs: the changed-file set is identical, and a diff of the two commits' diffs shows only those two lines.Verification
generate-openapi-spec,generate-supervisor-schemas-snapshot,generate-tasksdk-datamodels,generate-airflowctl-datamodels,sync-ts-sdk-schemas,sync-go-sdk-schemas— confirming the vendored artifacts match whatv3-4-testproduces rather than what main produces.validate_loop_decisionapplies cleanly to thestop: bool | Nonesignature already onv3-4-test.Was generative AI tooling used to co-author this PR?
Claude Opus 5
Generated-by: Claude Opus 5 following the guidelines