Sonins commented on issue #20632:
URL: https://github.com/apache/beam/issues/20632#issuecomment-1248533832

   So if you're having same trouble and want to bypass it, insert 
`beam.WindowInto(beam.window.GlobalWindows())` somewhere between 
`beam.WindowInto(beam.window.FixedWindows())` and `beam.io.WriteToBigQuery()`  
   
   For example, for test code I wrote above..
   
   ``` python
   class DataflowRunnerTest(unittest.TestCase, ExtraAssertionsMixin):
   ...
     def test_bigquery_dead_letter(self):
       runner = DataflowRunner()
   
       self.default_properties.append("--streaming")
   
       with beam.Pipeline(runner=runner, 
options=PipelineOptions(self.default_properties)) as p:
         
         (
           p
           | beam.io.ReadFromPubSub(topic='projects/project/topics/topic')
           | beam.WindowInto(beam.window.FixedWindows(2))
           | beam.GroupBy(lambda x: x.attributes['table'])
           | "global window" >> beam.WindowInto(beam.window.GlobalWindows()) # 
Insert this!
           # | beam.FlatMap(lambda x: x) # I think you can't use FlatMap on 
globalwindowed value
           | beam.Map(lambda x: x)
           | beam.io.WriteToBigQuery('some.table')
   
         )
   ```


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