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

   ### What would you like to happen?
   
   For example:
   ```
       output_batch_type = self.fn._get_output_batch_type_normalized(
     File 
"/tmp/tmp.PH23v4EA7w/venv/lib/python3.8/site-packages/apache_beam/transforms/core.py",
 line 828, in _get_output_batch_type_normalized
       self.get_output_batch_type(input_element_type))
     File 
"/tmp/tmp.PH23v4EA7w/venv/lib/python3.8/site-packages/apache_beam/transforms/core.py",
 line 872, in get_output_batch_type
       process_batch_type = self._get_element_type_from_return_annotation(
     File 
"/tmp/tmp.PH23v4EA7w/venv/lib/python3.8/site-packages/apache_beam/transforms/core.py",
 line 844, in _get_element_type_from_return_annotation
       raise TypeError(
   TypeError: Expected Iterator in return type annotation for <bound method 
BatchedGenerateSamples.process_batch of <__main__.BatchedGenerateSamples object 
at 0x7f4bb1c88f70>>, did you mean Iterator[<class 'numpy.ndarray'>]?
   ```
   
   This is pretty clear and actionable, but it could be a bit more informative. 
It could explain that Beam DoFns are one-to-N where N>=0, so they must always 
yield.
   
   ### Issue Priority
   
   Priority: 2
   
   ### Issue Component
   
   Component: sdk-py-core


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