lukecwik commented on a change in pull request #12275:
URL: https://github.com/apache/beam/pull/12275#discussion_r456679026



##########
File path: sdks/python/apache_beam/io/iobase.py
##########
@@ -1301,18 +1302,22 @@ def __repr__(self):
   @property
   def completed_work(self):
     # type: () -> float
-    if self._completed:
+    if self._completed is not None:
       return self._completed
-    elif self._remaining and self._fraction:
+    elif self._remaining is not None and self._fraction:
       return self._remaining * self._fraction / (1 - self._fraction)
+    else:
+      return self._fraction
 
   @property
   def remaining_work(self):
     # type: () -> float
-    if self._remaining:
+    if self._remaining is not None:
       return self._remaining
-    elif self._completed:
+    elif self._completed is not None and self._fraction:

Review comment:
       This one needs to also check whether `self._fraction` is not 0 otherwise 
we would divide by zero here.




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to