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

   ### What happened?
   
   Code to reproduce:
   ```python
   import apache_beam as beam
   from apache_beam.options.pipeline_options import PipelineOptions
   from apache_beam.transforms import window
   
   class _Unpicklable(object):
   
     def __init__(self, value):
       self.value = value
   
     def __getstate__(self):
       raise NotImplementedError()
   
     def __setstate__(self, state):
       raise NotImplementedError()
   
   class _UnpicklableCoder(beam.coders.Coder):
   
     def encode(self, value):
       return str(value.value).encode()
   
     def decode(self, encoded):
       return _Unpicklable(int(encoded.decode()))
   
     def to_type_hint(self):
       return _Unpicklable
   
     def is_deterministic(self):
       return True
   
   beam.coders.registry.register_coder(_Unpicklable, _UnpicklableCoder)
   
   def pipeline_fn(root):
     values = [_Unpicklable(i) for i in range(5)]
     #return root | beam.Create(values) | beam.Reshuffle() | beam.Map(lambda x: 
x.value*2)
     return root | beam.Create(values).with_output_types(_Unpicklable) \
         | beam.WindowInto(window.SlidingWindows(size=3, period=1)) \
         | beam.Reshuffle().with_output_types(_Unpicklable) \
         | beam.Map(lambda x: x.value*2)
   
   options = PipelineOptions(runner='DirectRunner', direct_num_workers=1)
   pipeline = beam.Pipeline(options=options)
   out = pipeline_fn(pipeline)
   result = pipeline.run()
   result.wait_until_finish()
   ```
   
   ### Issue Priority
   
   Priority: 2 (default / most bugs should be filed as P2)
   
   ### Issue Components
   
   - [X] Component: Python SDK
   - [ ] Component: Java SDK
   - [ ] Component: Go SDK
   - [ ] Component: Typescript SDK
   - [ ] Component: IO connector
   - [ ] Component: Beam YAML
   - [ ] Component: Beam examples
   - [ ] Component: Beam playground
   - [ ] Component: Beam katas
   - [ ] Component: Website
   - [ ] Component: Infrastructure
   - [ ] Component: Spark Runner
   - [ ] Component: Flink Runner
   - [ ] Component: Samza Runner
   - [ ] Component: Twister2 Runner
   - [ ] Component: Hazelcast Jet Runner
   - [ ] Component: Google Cloud Dataflow Runner


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