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

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

                Author: ASF GitHub Bot
            Created on: 18/Dec/19 02:02
            Start Date: 18/Dec/19 02:02
    Worklog Time Spent: 10m 
      Work Description: udim commented on pull request #9602: [BEAM-8269] 
Convert Py3 type hints to Beam types
URL: https://github.com/apache/beam/pull/9602#discussion_r359120339
 
 

 ##########
 File path: sdks/python/apache_beam/typehints/decorators_test_py3.py
 ##########
 @@ -33,18 +34,20 @@
 
 decorators._enable_from_callable = True
 T = TypeVariable('T')
+# Name is 'T' so it converts to a beam type with the same name.
+T_typing = typing.TypeVar('T')
 
 
 class IOTypeHintsTest(unittest.TestCase):
 
   def test_from_callable(self):
     def fn(a: int, b: str = None, *args: Tuple[T], foo: List[int],
-           **kwargs: Dict[str, str]) -> Tuple:
+           **kwargs: Dict[str, str]) -> Tuple[Any, ...]:
 
 Review comment:
   Yes if these were typing module types, but in this case this is 
`typehints.Tuple[typehints.Any, ...]`, which requires subscripting to turn it 
into a constraint. I will remove such usage in the future and make the 
`typehints.` prefix explicit.
   
   FYI, the conversion from typing.Tuple to a typehints.Tuple constraint is 
taken care of here: 
https://github.com/apache/beam/pull/10042/files#diff-9b2eac354738047adddd44814d4b429cR245
 
----------------------------------------------------------------
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: 361263)
    Time Spent: 2h 10m  (was: 2h)

> IOTypehints.from_callable doesn't convert native type hints to Beam
> -------------------------------------------------------------------
>
>                 Key: BEAM-8269
>                 URL: https://issues.apache.org/jira/browse/BEAM-8269
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-py-core
>            Reporter: Udi Meiri
>            Assignee: Udi Meiri
>            Priority: Major
>          Time Spent: 2h 10m
>  Remaining Estimate: 0h
>
> Users typically write type hints using typing module types. We should allow 
> that, be internally convert these type to Beam module types for now.
> In the future, Beam should stop using these internal types (BEAM-8156).



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

Reply via email to