apilloud commented on a change in pull request #15912:
URL: https://github.com/apache/beam/pull/15912#discussion_r744027287



##########
File path: sdks/python/apache_beam/transforms/util.py
##########
@@ -725,7 +725,7 @@ class Reshuffle(PTransform):
   """
 
   # We use 32-bit integer as the default number of buckets.
-  _DEFAULT_NUM_BUCKETS = 1 << 32
+  _DEFAULT_NUM_BUCKETS = (1 << 32) - 1

Review comment:
       Actually, there is an off by one error in the python: 
https://bugs.python.org/issue37000
   
   So even though it calls `getrandbits(33)` it rejects the result if it is 
more than 32 bits and retries. This change is correct.




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