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

   ### Under which category would you file this issue?
   
   Airflow Core
   
   ### Apache Airflow version
   
   3.2.2
   
   ### What happened and how to reproduce it?
   
   The DAG given below has inconsistent return values for the task group. If 
the group is only mapped once it will not pack the results in a list as it 
should for DTM.
   
   If you start it with a list with a single item in it e.g. ['14'], 
`consume_dtm` will receive it unpacked and print e.g. `1` and then `4`.
   If the list contains multiple items e.g. ['15', '23'], they will all be 
packed in lists and therefore printed e.g. `'15'` and `'23'` 
   
   iirc this worked fine in 3.1.5
   
   ```python
   from airflow.sdk import dag, task, task_group
   
   
   @dag
   def dtm_return_value(some_input: list = ()):
   
       @task
       def convert_dag_param(a):
           return a
   
       @task
       def do_something(a):
           return a
   
       @task_group
       def group(a):
           test = do_something(a)
           return {"test": test}
   
       @task
       def consume_dtm(dtm_result):
           for res in dtm_result:
               print(res)
   
       result = group.expand(a=convert_dag_param(some_input))
       consume_dtm(result["test"])
   
   
   instance = dtm_return_value()
   ```
   
   
   ### What you think should happen instead?
   
   It seems like the return value of the mapped task group gets unpacked if we 
have only 1 mapped task instance. 
   The return value should consistently be packed (result of a mapped task must 
always be a list)
   
   ### Operating System
   
   _No response_
   
   ### Deployment
   
   Official Apache Airflow Helm Chart
   
   ### Apache Airflow Provider(s)
   
   _No response_
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Official Helm Chart version
   
   1.22.0 (latest released)
   
   ### Kubernetes Version
   
   _No response_
   
   ### Helm Chart configuration
   
   _No response_
   
   ### Docker Image customizations
   
   _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