[ 
https://issues.apache.org/jira/browse/BEAM-8490?focusedWorklogId=353000&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-353000
 ]

ASF GitHub Bot logged work on BEAM-8490:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 03/Dec/19 21:33
            Start Date: 03/Dec/19 21:33
    Worklog Time Spent: 10m 
      Work Description: udim commented on pull request #9894: [BEAM-8490] Fix 
instance_to_type for empty containers
URL: https://github.com/apache/beam/pull/9894#discussion_r353433167
 
 

 ##########
 File path: sdks/python/apache_beam/typehints/trivial_inference.py
 ##########
 @@ -65,18 +65,27 @@ def instance_to_type(o):
   elif t == tuple:
     return typehints.Tuple[[instance_to_type(item) for item in o]]
   elif t == list:
-    return typehints.List[
-        typehints.Union[[instance_to_type(item) for item in o]]
-    ]
+    if len(o):
 
 Review comment:
   done
 
----------------------------------------------------------------
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:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 353000)
    Time Spent: 1h  (was: 50m)

> Python typehints: properly resolve empty dict type
> --------------------------------------------------
>
>                 Key: BEAM-8490
>                 URL: https://issues.apache.org/jira/browse/BEAM-8490
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-py-core
>            Reporter: Udi Meiri
>            Assignee: Udi Meiri
>            Priority: Major
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> Currently:
> {code}
> trivial_inference.instance_to_type({})
> {code}
> returns
> {code}
> Dict[Union[], Union[]]
> {code}
> instead of
> {code}
> Dict[Any,Any]
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to