tvalentyn commented on issue #20551:
URL: https://github.com/apache/beam/issues/20551#issuecomment-1164290599

   I couldn't repro this. Tried:
   
   ```
   import apache_beam as beam
   
   def main():
   
     class SideFn(beam.PartitionFn):
       def partition_for(self, element, *args, **kwargs):
         print(element, args, kwargs)
         return 0
   
     def just_print(element, *args, **kwargs):
       print(element, args, kwargs)
   
     with beam.Pipeline() as p:
       side = p | 'CreateSide' >> beam.Create(['a'])
       p | beam.Create([1, 2, 3]) | beam.Partition(SideFn(), 99, 
side=beam.pvalue.AsSingleton(side))
   
       p | 'Create2' >> beam.Create([1, 2, 3]) | beam.ParDo(just_print, 99, 
side=beam.pvalue.AsSingleton(side))
   
   if __name__ == '__main__':
     main()
   ```
   
   ```
   python pipe.py
   1 (99,) {'side': 'a'}
   2 (99,) {'side': 'a'}
   3 (99,) {'side': 'a'}
   1 (99,) {'side': 'a'}
   2 (99,) {'side': 'a'}
   3 (99,) {'side': 'a'}
   ```


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