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 2021/11/16 03:27:26 UTC

[GitHub] [airflow] uranusjr commented on a change in pull request #19608: Enhance `multiple_outputs` inference of dict typing

uranusjr commented on a change in pull request #19608:
URL: https://github.com/apache/airflow/pull/19608#discussion_r749872025



##########
File path: airflow/decorators/base.py
##########
@@ -202,7 +202,16 @@ def task_decorator_factory(
     # try to infer from  type annotation
     if python_callable and multiple_outputs is None:
         sig = signature(python_callable).return_annotation
-        ttype = getattr(sig, "__origin__", None)
+
+        # If the return type annotation is already the builtins ``dict`` type, use it for the inference.
+        if sig == dict:
+            ttype = sig

Review comment:
       Does this cover `typing.Dict` and e.g. `typing.Dict[str, typing.Any]`?




-- 
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: commits-unsubscribe@airflow.apache.org

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