Enhance TaskInstance and PlainXComArg to support post-expansion placeholders#68454
Enhance TaskInstance and PlainXComArg to support post-expansion placeholders#68454bramhanandlingala wants to merge 6 commits into
Conversation
SameerMesiah97
left a comment
There was a problem hiding this comment.
I think there is a conceptual issue with this PR. I understand the original issue mentions that my original fix in PR #59691 was addressing XCom Arg resolution but that is not entirely accurate (keep in mind that the body of the issue #68454 is AI-generated so it could be a hallucination). PR #59691 is meant to address an unexpected behaviour during trigger rule evaluation due to a missing upstream placeholder/summary task instance. In other words, XCom Arg resolution is not being touched (that is the precursor step to trigger rule evaluation which is where this the bug addressed in PR #59691 arose).
I have checked one potential fix locally which builds upon PR #67684 by adding TR.NONE_FAILED_MIN_ONE_SUCCESS like this:
is_fast_triggered = task.trigger_rule in (TR.ONE_SUCCESS, TR.ONE_FAILED, TR.ONE_DONE, TR.NONE_FAILED_MIN_ONE_SUCCESS)
I have not run the entire test suite for airflow core but this did not break the existing tests in test_mappedoperator.py and there are other trigger rules under which the bug may arise. But doing the above appeared to have fixed the original issue being addressed by addressed by PR #59691. So you may explore this approach instead.
|
Do you plan on continuing work on this? |
…r to get_relevant_upstream_map_indexes
|
Hi @kaxil , @amoghrajesh All checks are passing and the branch has been updated. Could you please take a look at this PR? |
Can you run the following DAG using the code from Please provide screenshots if possible. |
|
Thanks for the suggestion. I'll run the provided DAG on the latest main branch and compare the behavior with my fix. I'll report back with the results shortly. |
Description
This change reintroduces the placeholder upstream map-index resolution behavior from #59691 while avoiding the regression that caused incorrect trigger-rule evaluation in mapped task groups.
The placeholder-to-expanded-instance (
-1→0) resolution is now applied only where required for XCom resolution. Trigger-rule dependency evaluation continues to use the original map-index resolution behavior, preserving per-index expansion semantics for mapped task groups.This ensures that downstream placeholder tasks can correctly resolve upstream references after expansion without affecting the behavior validated by the regressions addressed in #50210.
Tests
test_downstream_placeholder_handles_upstream_post_expansiontest_one_failed_trigger_rule_in_mapped_task_group_is_per_indextest_one_failed_trigger_rule_runs_on_indirect_failure_in_mapped_task_groupFixes: #68417
Important
🛠️ Maintainer triage note for @bramhanandlingala · by
@potiuk· 2026-06-22 06:31 UTCHelpful heads-up from the maintainers — please address before this PR can be reviewed (see the Pull Request quality criteria):
The ball is in your court — you've been assigned to this PR. Fix the above, then mark it Ready for review.
Automated triage — may be imperfect; a maintainer takes the next look.