[GitHub] [beam] monicadsong commented on a change in pull request #12851: [BEAM-10900] add ability for ApproximateUniqueCombineFn to handle numpy input data
monicadsong commented on a change in pull request #12851: URL: https://github.com/apache/beam/pull/12851#discussion_r489074298 ## File path: sdks/python/apache_beam/transforms/stats_test.py ## @@ -89,6 +90,12 @@ def setUp(self): None, 0.1, 'assert:global_by_error_with_large_population'), + ( + 'numpy_input_data', + np.array(range(10)), Review comment: Ah sorry, just saw this. I didn't like the assumption I made about the type of elements in the PCollection either, and the use case you mention is definitely unsupported with this draft edit but would not alert the user if they made that mistake. 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: us...@infra.apache.org
[GitHub] [beam] monicadsong commented on a change in pull request #12851: [BEAM-10900] add ability for ApproximateUniqueCombineFn to handle numpy input data
monicadsong commented on a change in pull request #12851: URL: https://github.com/apache/beam/pull/12851#discussion_r488863704 ## File path: sdks/python/apache_beam/transforms/stats_test.py ## @@ -89,6 +90,12 @@ def setUp(self): None, 0.1, 'assert:global_by_error_with_large_population'), + ( + 'numpy_input_data', + np.array(range(10)), Review comment: No. For numpy input I am assuming that for ApproxUniqueCombineFn.add_input(self, accumulator, element), element is a numpy scalar or numpy array with 1 element. 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: us...@infra.apache.org
[GitHub] [beam] monicadsong commented on a change in pull request #12851: [BEAM-10900] add ability for ApproximateUniqueCombineFn to handle numpy input data
monicadsong commented on a change in pull request #12851: URL: https://github.com/apache/beam/pull/12851#discussion_r488865232 ## File path: sdks/python/apache_beam/transforms/stats_test.py ## @@ -89,6 +90,12 @@ def setUp(self): None, 0.1, 'assert:global_by_error_with_large_population'), + ( + 'numpy_input_data', + np.array(range(10)), Review comment: I can allow multidimensional numpy arrays as input if you want. 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: us...@infra.apache.org
[GitHub] [beam] monicadsong commented on a change in pull request #12851: [BEAM-10900] add ability for ApproximateUniqueCombineFn to handle numpy input data
monicadsong commented on a change in pull request #12851: URL: https://github.com/apache/beam/pull/12851#discussion_r488863704 ## File path: sdks/python/apache_beam/transforms/stats_test.py ## @@ -89,6 +90,12 @@ def setUp(self): None, 0.1, 'assert:global_by_error_with_large_population'), + ( + 'numpy_input_data', + np.array(range(10)), Review comment: No. For numpy input I am assuming that for ApproxUniqueCombineFn.add_input(self, accumulator, element), element is a numpy scalar (not a numpy array). 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: us...@infra.apache.org
[GitHub] [beam] monicadsong commented on a change in pull request #12851: [BEAM-10900] add ability for ApproximateUniqueCombineFn to handle numpy input data
monicadsong commented on a change in pull request #12851: URL: https://github.com/apache/beam/pull/12851#discussion_r488863704 ## File path: sdks/python/apache_beam/transforms/stats_test.py ## @@ -89,6 +90,12 @@ def setUp(self): None, 0.1, 'assert:global_by_error_with_large_population'), + ( + 'numpy_input_data', + np.array(range(10)), Review comment: No. For numpy input I am assuming that for ApproxUniqueCombineFn.add_input(self, accumulator, element), element is a numpy scalar (not a numpy array). However, if the element is a multidimensional numpy array, then calling element.item(0) returns the value at the first index of the array as a python type. 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: us...@infra.apache.org