[
https://issues.apache.org/jira/browse/BEAM-10323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17191804#comment-17191804
]
Beam JIRA Bot commented on BEAM-10323:
--------------------------------------
This issue was marked "stale-P2" and has not received a public comment in 14
days. It is now automatically moved to P3. If you are still affected by it, you
can comment and move it back to 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)