jorisvandenbossche commented on a change in pull request #11882:
URL: https://github.com/apache/arrow/pull/11882#discussion_r782762409



##########
File path: python/pyarrow/tests/test_compute.py
##########
@@ -1262,6 +1263,300 @@ def test_filter_null_type():
     assert len(table.filter(mask).column(0)) == 5
 
 
[email protected]("ty", ["inclusive"])
+def test_between_array_array_array(ty):
+    BetweenOptions = partial(pc.BetweenOptions)
+
+    val = pa.array([1, 1, 4, 3, 2, 6])
+    arr1 = pa.array([1, 1, 3, 4, None, 5])
+    arr2 = pa.array([1, 2, 4, None, 4, 7])
+
+    inclusive_and_expected = {
+        "both": [True, True, True, None, None, True],
+        "left": [False, True, False, None, None, True],
+        "right": [False, False, True, None, None, True],
+        "neither": [False, False, False, None, None, True],
+    }
+
+    for inclusive, expected in inclusive_and_expected.items():
+        options = BetweenOptions(inclusive=inclusive)
+        result = pc.between(val, arr1, arr2, options=options)
+        np.testing.assert_array_equal(result, pa.array(expected))

Review comment:
       This is adding a lot of testing code, though (it's of course good to 
have thorough tests, but too much tests make it also harder to maintain the 
tests). 
   I was wondering, is the string version needed here in Python? (strings are 
already tested in C++ tests, and the integer tests in Python already ensure 
that arrays vs scalars and options are correctly passed). Leaving out those 
would already cut the test code here in half?




-- 
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]


Reply via email to