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

   **What happened?**
   
   When I tried to read from a mongodb collection with only a single document 
in it, the worker returns "float division by zero" error.  The source database 
is deployed in mongodb atlas and the pipeline is deployed on gcp dataflow 
runner.  Below is the code we used and the error message got:
   
   
   **Code**: 
   
   `pipeline | ReadFromMongoDB(uri=..., db=...,  coll=..., bucket_auto=True)`
   
   
   **ERROR**:
   > Error message from worker: Traceback (most recent call last):
   >   File 
"/usr/local/lib/python3.7/site-packages/dataflow_worker/batchworker.py", line 
646, in do_work
   >     work_executor.execute()
   >   File 
"/usr/local/lib/python3.7/site-packages/dataflow_worker/executor.py", line 208, 
in execute
   >     op.start()
   >   File "dataflow_worker/native_operations.py", line 38, in 
dataflow_worker.native_operations.NativeReadOperation.start
   >   File "dataflow_worker/native_operations.py", line 40, in 
dataflow_worker.native_operations.NativeReadOperation.start
   >   File "dataflow_worker/native_operations.py", line 44, in 
dataflow_worker.native_operations.NativeReadOperation.start
   >   File "dataflow_worker/native_operations.py", line 49, in 
dataflow_worker.native_operations.NativeReadOperation.start
   >   File 
"/usr/local/lib/python3.7/site-packages/dataflow_worker/workercustomsources.py",
 line 112, in get_progress
   >     fraction = self._range_tracker.fraction_consumed()
   >   File 
"/usr/local/lib/python3.7/site-packages/apache_beam/io/range_trackers.py", line 
286, in fraction_consumed
   >     self._last_claim, self._start_position, self._stop_position)
   >   File 
"/usr/local/lib/python3.7/site-packages/apache_beam/io/range_trackers.py", line 
432, in position_to_fraction
   >     return float(ikey - istart) / (iend - istart)
   > ZeroDivisionError: float division by zero
   


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