[
https://issues.apache.org/jira/browse/BEAM-10323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17548721#comment-17548721
]
Danny McCormick commented on BEAM-10323:
----------------------------------------
This issue has been migrated to https://github.com/apache/beam/issues/20344
> 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.20.7#820007)