You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/06/04 16:37:30 UTC

[GitHub] [beam] damccorm opened a new issue, #20344: Python type hints: make WindowedValue, TimestampedValue Generic

damccorm opened a new issue, #20344:
URL: https://github.com/apache/beam/issues/20344

   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):
   ```
   
     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)
   
   ```
   
   
   Imported from Jira [BEAM-10323](https://issues.apache.org/jira/browse/BEAM-10323). Original Jira may contain additional context.
   Reported by: udim.


-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org