monicadsong commented on a change in pull request #12756:
URL: https://github.com/apache/beam/pull/12756#discussion_r483159262
##########
File path: sdks/python/apache_beam/transforms/stats.py
##########
@@ -192,7 +193,7 @@ def get_estimate(self):
if len(self._sample_heap) < self._sample_size:
return len(self._sample_heap)
else:
- sample_space_size = sys.maxsize - 1.0 * self._min_hash
+ sample_space_size = self._HASH_SPACE_SIZE - 1.0 * self._min_hash
Review comment:
Valentyn-- you're right, forgot to update self._HASH_SPACE_SIZE. I think
originally pythons hash() can return negative value, so the total hash space
ranges from (- sys.maxsize, sys.maxsize).
----------------------------------------------------------------
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:
[email protected]