You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2020/09/02 17:58:49 UTC

[GitHub] [beam] tvalentyn commented on a change in pull request #12756: [BEAM-10824] [BEAM-7654] Change hash function in ApproximateUniqueCombineFn

tvalentyn commented on a change in pull request #12756:
URL: https://github.com/apache/beam/pull/12756#discussion_r482261286



##########
File path: sdks/python/apache_beam/transforms/stats_test.py
##########
@@ -496,6 +483,51 @@ 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_add_values(self):

Review comment:
       nit: you could call this: test_approximate_unique_combine_fn_adds_values_correctly instead of adding a comment.




----------------------------------------------------------------
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:
users@infra.apache.org