retsilla opened a new issue, #49714:
URL: https://github.com/apache/airflow/issues/49714

   ### Apache Airflow version
   
   3.0.0
   
   ### If "Other Airflow 2 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   When dynamically creating task groups and creating a task to consume 
combined results, the input received by the consuming task is `None` rather 
than a list of combined results.
   
   ### What you think should happen instead?
   
   According to the [example in 
docs](https://airflow.apache.org/docs/apache-airflow/stable/authoring-and-scheduling/dynamic-task-mapping.html#depending-on-a-mapped-task-group-s-output)
 and behaviour in previous versions of Airflow the result passed to the 
consuming tasks should be a combined list of results from the task group 
instances.
   
   ### How to reproduce
   
   DAG derived from the [example in the 
docs](https://airflow.apache.org/docs/apache-airflow/stable/authoring-and-scheduling/dynamic-task-mapping.html#depending-on-a-mapped-task-group-s-output):
   ```python
   from datetime import datetime
   
   from airflow.sdk import DAG, task, task_group
   
   with DAG(
       dag_id="dynamic_task_group_dag",
       start_date=datetime(2025, 1, 1),
       schedule=None,
   ):
   
       @task_group
       def add_one_and_double(value: int):
           @task
           def add_one(value: int):
               return value + 1
   
           @task
           def double(value: int):
               return value * 2
   
           new_value = add_one(value)
           return double(new_value)
   
       @task
       def consumer(values: list[int]):
           print(f"New values are: {values}")
   
       results = add_one_and_double.expand(value=[1, 2, 3])
       consumer(results)  # Should receive [4, 6, 8] but gets null
   ```
   
   
![Image](https://github.com/user-attachments/assets/646fc592-31d2-4fa5-8c9f-bdcd784c30b6)
   
   Logs of `consumer` task showing null was received:
   ```
   [2025-04-24, 13:14:50] INFO - DAG bundles loaded: dags-folder: 
source="airflow.dag_processing.bundles.manager.DagBundlesManager"
   [2025-04-24, 13:14:50] INFO - Filling up the DagBag from 
/home/airflow/dags/dynamic_task_group_dag.py: 
source="airflow.models.dagbag.DagBag"
   [2025-04-24, 13:14:50] INFO - Done. Returned value was: None: 
source="airflow.task.operators.airflow.providers.standard.decorators.python._PythonDecoratedOperator"
   [2025-04-24, 13:14:50] INFO - New values are: None: chan="stdout": 
source="task"
   ```
   
   ### Operating System
   
   Debian GNU/Linux 12
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Docker-Compose
   
   ### Deployment details
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


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