diff --git a/.github/trigger_files/beam_PreCommit_Flink_Container.json b/.github/trigger_files/beam_PreCommit_Flink_Container.json index 3f63c0c9975f..bbdc3a3910ef 100644 --- a/.github/trigger_files/beam_PreCommit_Flink_Container.json +++ b/.github/trigger_files/beam_PreCommit_Flink_Container.json @@ -1,4 +1,4 @@ { "comment": "Modify this file in a trivial way to cause this test suite to run", - "modification": 2 + "modification": 3 } diff --git a/sdks/python/apache_beam/testing/fast_test_utils.pxd b/sdks/python/apache_beam/testing/fast_test_utils.pxd index f8868e842b4a..b35566a579eb 100644 --- a/sdks/python/apache_beam/testing/fast_test_utils.pxd +++ b/sdks/python/apache_beam/testing/fast_test_utils.pxd @@ -29,5 +29,5 @@ cdef class LCGenerator(object): cpdef void seed_jdk(self, libc.stdint.uint64_t seed) cpdef libc.stdint.int32_t next_int(self) cpdef libc.stdint.uint32_t next_uint(self) - cpdef bytes rand_bytes(self, int length) + cpdef bytes randbytes(self, int length) cpdef double random_sample(self) \ No newline at end of file diff --git a/sdks/python/apache_beam/testing/fast_test_utils.pyx b/sdks/python/apache_beam/testing/fast_test_utils.pyx index d815bcfe8f96..d9e4481b5149 100644 --- a/sdks/python/apache_beam/testing/fast_test_utils.pyx +++ b/sdks/python/apache_beam/testing/fast_test_utils.pyx @@ -44,7 +44,7 @@ cdef class LCGenerator(object): self.seed(self._seed) return (self._seed >> (self._bits - 32)) - cpdef bytes rand_bytes(self, int length): + cpdef bytes randbytes(self, int length): cdef libc.stdint.int32_t ints = (length + 3) // 4 cdef char* data = libc.stdlib.malloc(ints * 4) cdef libc.stdint.uint32_t value diff --git a/sdks/python/apache_beam/testing/test_utils.py b/sdks/python/apache_beam/testing/test_utils.py index 03d77df950d5..e31c53765b81 100644 --- a/sdks/python/apache_beam/testing/test_utils.py +++ b/sdks/python/apache_beam/testing/test_utils.py @@ -273,7 +273,7 @@ def next_uint(self): self.seed(self._seed) return self._seed >> (self._bits - 32) - def rand_bytes(self, length): + def randbytes(self, length): """ Get random bytes of given length. diff --git a/sdks/python/apache_beam/testing/test_utils_test.py b/sdks/python/apache_beam/testing/test_utils_test.py index cef19f67b4ea..1a89ada2a709 100644 --- a/sdks/python/apache_beam/testing/test_utils_test.py +++ b/sdks/python/apache_beam/testing/test_utils_test.py @@ -107,7 +107,7 @@ def test_generator_seed_results(self): self.assertEqual(generator.next_int(), -1151252339) self.assertEqual(generator.next_uint(), 3745583449) self.assertAlmostEqual(generator.random_sample(), 0.375548, delta=1e-6) - self.assertEqual(generator.rand_bytes(10), b'\xa6\x8fW\xcb\xb1\xa88]dP') + self.assertEqual(generator.randbytes(10), b'\xa6\x8fW\xcb\xb1\xa88]dP') def test_generator_seed_jdk_results(self): generator = self.Generator() @@ -119,7 +119,7 @@ def test_generator_seed_jdk_results(self): self.assertEqual(generator.next_int(), -1155869325) self.assertEqual(generator.next_uint(), 431529176) self.assertAlmostEqual(generator.random_sample(), 0.410081, delta=1e-6) - self.assertEqual(generator.rand_bytes(10), b'\x92\xf9Mh\xfc\xcc,5\xf0\xb8') + self.assertEqual(generator.randbytes(10), b'\x92\xf9Mh\xfc\xcc,5\xf0\xb8') try: