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

   ### Apache Airflow version
   
   main (development)
   
   ### What happened
   
   if using the TaskFlow API and one does the following
   
   ```
   @task()
   def MyFunc(myarg: int) -> dict:
     return dict({x: "y", z: "x"})
   
   ```
   
   Airflow automatically unwinds `dict` automatically into separate variables 
`x` and `z` and if you do not want that kind of bahavior you will need to set 
`multiple_outputs=False`. While this is in the documentation, it is rather non 
intuitive requiring someone to be aware of the documentation that the `default` 
of `multiple_outputs` changes depending the return type of your function. 
Moreover, it is unexpected behavior for people coming from plain python (e.g. 
someone converting their functions to Airflow tasks) and wanting to do:
   
   ```
   @task()
   def f1(myarg: int) -> dict:
     return dict({x: myarg, z: "x"})
   
   @task
   def f2(in: dict):
     print(in)
   
   a = f1(10)
   f2(a)
   
   ```
   
   Which would sunddenly have issues in unittesting.
   
   
   cc @josh-fell @BasPH @uranusjr 
   
   ### What you think should happen instead
   
   Airflow should only unwind dicts if explicitly asked to do so.
   
   ### How to reproduce
   
   _No response_
   
   ### Operating System
   
   Not relevant
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Docker-Compose
   
   ### Deployment details
   
   _No response_
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] 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