Skip to content

Redo #59691: placeholder upstream map-index resolution breaks per-index expansion in mapped task groups #68417

@potiuk

Description

@potiuk

#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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions