You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/05/24 08:58:02 UTC

[GitHub] [airflow] turbaszek opened a new issue #8996: Use type hints to indicate multiple return values when using @task

turbaszek opened a new issue #8996:
URL: https://github.com/apache/airflow/issues/8996


   **Description**
   
   Use type hints to indicate multiple return values of `@task` decorated function to improve dereferencing. 
   
   Using type hints to enhance code behaviour is for example done in:
   https://databricks.com/blog/2020/05/20/new-pandas-udfs-and-python-type-hints-in-the-upcoming-release-of-apache-spark-3-0.html
   
   **Use case / motivation**
   
   Currently: 
   ```python
   @task(multiple_outputs=True)
   def my_function():
       return 1, 2, 3
   ```
   expected:
   ```
   @task
   def my_function() -> Tuple[int, int, int]:
       return 1, 2, 3
   ```
   
   **Related Issues**
   https://github.com/apache/airflow/pull/8962/files#r429341828
   https://github.com/apache/airflow/pull/8962/files#r428948073
   
   
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ashb closed issue #8996: Use type hints to indicate multiple return values when using @task

Posted by GitBox <gi...@apache.org>.
ashb closed issue #8996:
URL: https://github.com/apache/airflow/issues/8996


   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] AndersonReyes commented on issue #8996: Use type hints to indicate multiple return values when using @task

Posted by GitBox <gi...@apache.org>.
AndersonReyes commented on issue #8996:
URL: https://github.com/apache/airflow/issues/8996#issuecomment-674451499


   @turbaszek is this in todo? I want to give it a shot 


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] turbaszek commented on issue #8996: Use type hints to indicate multiple return values when using @task

Posted by GitBox <gi...@apache.org>.
turbaszek commented on issue #8996:
URL: https://github.com/apache/airflow/issues/8996#issuecomment-721727046


   > @kaxil , @turbaszek Should this be in beta1 from the perspective of feature complete?
   
   @vikramkoka I would say this adds only a syntax sugar not a "real feature" 


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] AndersonReyes edited a comment on issue #8996: Use type hints to indicate multiple return values when using @task

Posted by GitBox <gi...@apache.org>.
AndersonReyes edited a comment on issue #8996:
URL: https://github.com/apache/airflow/issues/8996#issuecomment-674451499


   @turbaszek is this still up for grabs? I want to give it a shot as first contribution


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] vikramkoka commented on issue #8996: Use type hints to indicate multiple return values when using @task

Posted by GitBox <gi...@apache.org>.
vikramkoka commented on issue #8996:
URL: https://github.com/apache/airflow/issues/8996#issuecomment-721281967


   @kaxil , @turbaszek  Should this be in beta1 from the perspective of feature complete? 


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on issue #8996: Use type hints to indicate multiple return values when using @task

Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #8996:
URL: https://github.com/apache/airflow/issues/8996#issuecomment-739818781


   Hey @turbaszek -> is ti somethig we want to add fo 2.0.0rc1 ? Or should we postpone to 2.1 ? If so - can you change the milestone please?


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] AndersonReyes commented on issue #8996: Use type hints to indicate multiple return values when using @task

Posted by GitBox <gi...@apache.org>.
AndersonReyes commented on issue #8996:
URL: https://github.com/apache/airflow/issues/8996#issuecomment-674455353


   after some googling looks like this can be achieved like this 
   
   ```
   ....
       if python_callable:
           sig = signature(python_callable).return_annotation
           if get_origin(sig) in (dict, tuple):
               multiple_outputs = True
   ....
   ```


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org