tadeja commented on code in PR #49908:
URL: https://github.com/apache/arrow/pull/49908#discussion_r3183467975
##########
python/pyarrow/tests/test_compute.py:
##########
@@ -2849,6 +2849,14 @@ def test_count():
pc.count(arr, 'something else')
+def test_count_run_end_encoded_nulls():
+ arr = pc.run_end_encode(pa.array([1, None]))
+
+ assert pc.count(arr, mode="only_valid").as_py() == 1
+ assert pc.count(arr, mode="only_null").as_py() == 1
+ assert pc.count(arr, mode="all").as_py() == 2
Review Comment:
```suggestion
arr = pc.run_end_encode(
pa.array([1, 1, None, None, None, 2, 2, 2, None, 3]))
assert pc.count(arr, mode="only_valid").as_py() == 6
assert pc.count(arr, mode="only_null").as_py() == 4
assert pc.count(arr, mode="all").as_py() == 10
# Slice crosses run boundaries: logical [None, None, 2, 2, 2, None].
assert pc.count(arr.slice(3, 6), mode="only_valid").as_py() == 3
assert pc.count(arr.slice(3, 6), mode="only_null").as_py() == 3
```
Similar suggestion here, so all three modes go over multiple runs and one
slice.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]