claudevdm commented on code in PR #40618:
URL: https://github.com/apache/beam/pull/40618#discussion_r4326688015


##########
sdks/python/apache_beam/io/gcp/bigquery_change_history.py:
##########
@@ -499,8 +511,7 @@ def _emit_query_ranges(
       self,
       start_ts: Timestamp,
       end_ts: Timestamp,
-      watermark_estimator: _PollWatermarkEstimator
-  ) -> Iterable[TimestampedValue[_QueryRange]]:

Review Comment:
   I think there's an issue with typehinting where if process is annotated to 
yield TimestampedValue[T]  related to 
https://github.com/apache/beam/issues/20344
   
   E.g. 
   ```
   from typing import Iterable
   
   import apache_beam as beam
   from apache_beam.transforms.window import TimestampedValue
   
   
   class AddTimestamp(beam.DoFn):
     def process(self, x: int) -> Iterable[TimestampedValue[int]]:
       yield TimestampedValue(x, x)
   
   
   with beam.Pipeline() as p:
     ints = p | beam.Create([1, 2, 3]) | beam.ParDo(AddTimestamp())
     print('element_type:', ints.element_type)
     _ = ints | beam.Map(lambda x: x + 1).with_input_types(int)
   ```
   
   results in
   
   ```
   element_type: apache_beam.transforms.window.TimestampedValue[int]
   TypeCheckError: The transform 'Map(<lambda ...>)' requires PCollections of 
type '<class 'int'>'
   but was applied to a PCollection of type 
'apache_beam.transforms.window.TimestampedValue[int]'
   ```
   
   



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to