tvalentyn commented on a change in pull request #12756:
URL: https://github.com/apache/beam/pull/12756#discussion_r483167308
##########
File path: sdks/python/apache_beam/transforms/stats_test.py
##########
@@ -496,6 +483,62 @@ def
test_approximate_unique_globally_by_error_with_skewed_data(self):
equal_to([True]),
label='assert:globally_by_error_with_skewed_data')
+ def test_approximate_unique_combine_fn_by_nondeterministic_coder(self):
+ # test if the combiner throws an error with a nondeterministic coder.
+ sample_size = 30
+ coder = coders.Base64PickleCoder()
+
+ with self.assertRaises(ValueError) as e:
+ _ = ApproximateUniqueCombineFn(sample_size, coder)
+
+ self.assertRegex(
+ e.exception.args[0],
+ 'The key coder "Base64PickleCoder" '
+ 'for ApproximateUniqueCombineFn is not deterministic.')
+
+ def test_approximate_unique_combine_fn_by_wrong_coder(self):
Review comment:
naming suggestion:
test_approximate_unique_combine_fn_requires_compatible_coder
##########
File path: sdks/python/apache_beam/transforms/stats_test.py
##########
@@ -496,6 +483,62 @@ def
test_approximate_unique_globally_by_error_with_skewed_data(self):
equal_to([True]),
label='assert:globally_by_error_with_skewed_data')
+ def test_approximate_unique_combine_fn_by_nondeterministic_coder(self):
Review comment:
naming suggestion:
test_approximate_unique_combine_fn_requires_deterministic_coder
----------------------------------------------------------------
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]