You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "Beam JIRA Bot (Jira)" <ji...@apache.org> on 2020/09/07 17:07:01 UTC

[jira] [Updated] (BEAM-10323) Python type hints: make WindowedValue, TimestampedValue Generic

     [ https://issues.apache.org/jira/browse/BEAM-10323?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Beam JIRA Bot updated BEAM-10323:
---------------------------------
    Labels:   (was: stale-P2)

> Python type hints: make WindowedValue, TimestampedValue Generic
> ---------------------------------------------------------------
>
>                 Key: BEAM-10323
>                 URL: https://issues.apache.org/jira/browse/BEAM-10323
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-py-core
>            Reporter: Udi Meiri
>            Priority: P3
>
> The above classes are used as return value wrappers, thus when converting return value annotations to type hints, the argument of these should be used as the hint.
> Example (this should pass but doesn't currently):
> {code}
>   def test_timestamped_value(self):
>     def timestamped(e: int) -> beam.window.TimestampedValue[int]:
>       return beam.window.TimestampedValue(e, 0)
>     with TestPipeline() as p:
>       pcoll = p | beam.Create([1, 2, 3]) | beam.Map(timestamped)
>       self.assertEqual(int, pcoll.element_type)
> {code}



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