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/11/11 22:22:59 UTC

[GitHub] [airflow] turbaszek commented on a change in pull request #10349: infer multiple_output from return type annotation

turbaszek commented on a change in pull request #10349:
URL: https://github.com/apache/airflow/pull/10349#discussion_r521674105



##########
File path: docs/tutorial_taskflow_api.rst
##########
@@ -144,6 +144,22 @@ the dependencies as shown below.
     :end-before: [END main_flow]
 
 
+Multiple outputs inference
+--------------------------
+Tasks can also infer multiple outputs by using dict python typing.
+
+.. code-block:: python
+
+    @task
+    def identity_dict(x: int, y: int) -> Dict[str, int]:
+        return {"x": x, "y": y}
+
+By using the typing ``Dict`` for the function return type, the ``multiple_outputs`` parameter
+is automatically set to true.
+
+Not, If you manually set the ``multiple_outputs`` parameter the inference is disabled and

Review comment:
       ```suggestion
   Note, if you manually set the ``multiple_outputs`` parameter the inference is disabled and
   ```
   Or did you have something else in your mind?




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