shahar1 opened a new pull request, #69075:
URL: https://github.com/apache/airflow/pull/69075

   A task consuming the output of a mapped task group from **outside** that 
group must always receive a list with one element per expansion. When the 
task-start upstream map-index computation moved into the Task SDK (#60803, 
released in 3.2.0), an unmapped downstream resolving a task inside a mapped 
task group started falling through to pulling all map indexes via `xcom_pull`, 
which collapses a single value to a bare scalar and an empty set of values to 
`None`.
   
   As a result:
   
   - A mapped task group that expanded **only once** handed the raw return 
value to the downstream task instead of a one-element list (#69036 — e.g. the 
consumer received `'14'` and iterated `'1'`, `'4'` instead of receiving 
`['14']`).
   - A mapped task group whose expansions **all returned `None`** would hand 
`None` instead of an empty list (the #48005 class of bug, via the task-group 
resolution path).
   
   This worked correctly in 3.1.5: the pre-3.2 server returned 
`list(range(mapped_ti_count))` for this case, guaranteeing a list. The fix 
resolves this case through a `LazyXComSequence`, mirroring how a directly 
mapped task already resolves, so the result is always a list regardless of how 
many times the group expanded or whether every value was `None`.
   
   Verified end to end with `airflow dags test` on the reproduction DAGs from 
both issues:
   
   - single expansion now yields `['14']` (was `'14'`),
   - multiple expansions still yield the full list,
   - all-`None` group expansions yield `[]`,
   - the directly-mapped all-`None` case from #48005 continues to yield `[]`.
   
   closes: #69036
   related: #48005
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Opus 4.8)
   
   Generated-by: Claude Code (Opus 4.8) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)


-- 
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]

Reply via email to