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

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

                Author: ASF GitHub Bot
            Created on: 10/Sep/19 23:20
            Start Date: 10/Sep/19 23:20
    Worklog Time Spent: 10m 
      Work Description: udim commented on pull request #9509: [BEAM-8156] Add 
convert_to_typing_type
URL: https://github.com/apache/beam/pull/9509#discussion_r323002366
 
 

 ##########
 File path: sdks/python/apache_beam/typehints/native_type_compatibility.py
 ##########
 @@ -198,6 +202,10 @@ def convert_to_beam_type(typ):
           arity=-1,
           beam_type=typehints.Tuple),
       _TypeMapEntry(match=_match_is_union, arity=-1, 
beam_type=typehints.Union),
+      _TypeMapEntry(
+          match=_match_issubclass(typing.Iterator),
 
 Review comment:
   PTAL. I don't see how I can implement bidirectional conversion of internal 
and external types without at least supporting all internal types. Otherwise 
we'll break existing users.
 
----------------------------------------------------------------
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:
us...@infra.apache.org


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

            Worklog Id:     (was: 310174)
    Remaining Estimate: 502h 40m  (was: 502h 50m)
            Time Spent: 1h 20m  (was: 1h 10m)

> Finish migration to standard Python typing
> ------------------------------------------
>
>                 Key: BEAM-8156
>                 URL: https://issues.apache.org/jira/browse/BEAM-8156
>             Project: Beam
>          Issue Type: Improvement
>          Components: sdk-py-core
>            Reporter: Robert Bradshaw
>            Assignee: Udi Meiri
>            Priority: Major
>   Original Estimate: 504h
>          Time Spent: 1h 20m
>  Remaining Estimate: 502h 40m
>
> We should migrate all Python uses of types to the standard typing module, and 
> make the typehints.* ones aliases of the Python ones. 
>  
> There are three places where we use custom typehints behavior: 
> (1) is_compatible_with
> (2) bind_type_variables/match_type_variables
> (3) trivial type inference. 
>  
> I would propose that each of these be adapted to a (internal) public 
> interface that accepts and returns standard typing types, and internally 
> converts to our (nowhere else exposed) typehints types, performs the logic, 
> and converts back. Each of these in turn can then be updated, as needed and 
> orthogonally, to operate on the typing types natively (possibly via deference 
> to a third-party library). 
>  
> I think coder inference could be easily adopted to use typing types directly, 
> but it may be a fourth place where we do internal conversion first. Another 
> gotcha is special care may need to be taken if we ever need to pickle these 
> types (which IIRC may have issues). 



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Reply via email to