Skip to content

Commit

Permalink
Merge pull request #15912: [BEAM-13080] Fix number of default keys in…
Browse files Browse the repository at this point in the history
… Reshuffle
  • Loading branch information
apilloud committed Nov 6, 2021
2 parents a3bb58d + ba6aa4e commit c04a2a8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sdks/python/apache_beam/transforms/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ def expand(self, pcoll):
# type: (pvalue.PValue) -> pvalue.PCollection
return (
pcoll | 'AddRandomKeys' >>
Map(lambda t: (random.randint(0, self.num_buckets), t)
Map(lambda t: (random.randrange(0, self.num_buckets), t)
).with_input_types(T).with_output_types(Tuple[int, T])
| ReshufflePerKey()
| 'RemoveRandomKeys' >> Map(lambda t: t[1]).with_input_types(
Expand Down

0 comments on commit c04a2a8

Please sign in to comment.