You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/01/04 15:14:23 UTC

[GitHub] [arrow] pitrou commented on a change in pull request #9079: ARROW-10578: [C++] Comparison kernels crashing for string array with null string scalar

pitrou commented on a change in pull request #9079:
URL: https://github.com/apache/arrow/pull/9079#discussion_r551374612



##########
File path: python/pyarrow/tests/test_compute.py
##########
@@ -803,12 +836,17 @@ def con(values): return pa.array(values)
         def con(values): return pa.chunked_array([values])
 
     arr = con([1, 2, 3, None])
-    # TODO this is a hacky way to construct a scalar ..
-    scalar = pa.array([2]).sum()
+    scalar = pa.scalar(2)
 
     result = pc.equal(arr, scalar)
     assert result.equals(con([False, True, False, None]))
 
+    if typ == "array":
+        nascalar = pa.scalar(None, type="int64")
+        result = pc.equal(arr, nascalar)
+        isnull = pc.is_null(result)

Review comment:
       Or simply: `assert result.to_pylist() == [None, None, None, None]`




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