#59691 ("Fix upstream map index resolution after placeholder expansion") was reverted in #68418 because it regressed per-index trigger-rule evaluation inside mapped task groups.
What #59691 did: added _should_use_post_expansion_placeholder in taskinstance.py, which rewrites a downstream placeholder's upstream resolution from map_index=-1 to 0 once the upstream has expanded.
Why it broke main: the same helper feeds both XCom/arg resolution (the case #59691 targeted) and trigger-rule dependency evaluation. For a task in a mapped task group whose upstream is in the same group (e.g. divide(i) >> report_success(i)), rewriting the summary instance (-1) to upstream index 0 makes it inherit that single instance's state — so when divide(0) fails, the downstream summary is marked UPSTREAM_FAILED and never expands. This regressed the #50210 fix; test_one_failed_trigger_rule_in_mapped_task_group_is_per_index (and the whole Core...Serialization job) went red on main.
Acceptance criteria for a redo:
cc @SameerMesiah97
Drafted-by: Claude Code (Opus 4.8); reviewed by @potiuk before posting
#59691 ("Fix upstream map index resolution after placeholder expansion") was reverted in #68418 because it regressed per-index trigger-rule evaluation inside mapped task groups.
What #59691 did: added
_should_use_post_expansion_placeholderintaskinstance.py, which rewrites a downstream placeholder's upstream resolution frommap_index=-1to0once the upstream has expanded.Why it broke main: the same helper feeds both XCom/arg resolution (the case #59691 targeted) and trigger-rule dependency evaluation. For a task in a mapped task group whose upstream is in the same group (e.g.
divide(i) >> report_success(i)), rewriting the summary instance (-1) to upstream index0makes it inherit that single instance's state — so whendivide(0)fails, the downstream summary is markedUPSTREAM_FAILEDand never expands. This regressed the #50210 fix;test_one_failed_trigger_rule_in_mapped_task_group_is_per_index(and the wholeCore...Serializationjob) went red onmain.Acceptance criteria for a redo:
test_downstream_placeholder_handles_upstream_post_expansion(the Fix upstream map index resolution after placeholder expansion #59691 scenario) passes, andtest_one_failed_trigger_rule_in_mapped_task_group_is_per_index+test_one_failed_trigger_rule_runs_on_indirect_failure_in_mapped_task_group(the Unexpected behavior of dynamically generated task with TriggerRule ONE_FAILED #50210 scenarios) pass.trigger_rule_dep.py).cc @SameerMesiah97
Drafted-by: Claude Code (Opus 4.8); reviewed by @potiuk before posting