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 2020/08/05 14:01:18 UTC

[GitHub] [arrow] pitrou commented on a change in pull request #7866: ARROW-7218: [Python] Conversion from boolean numpy scalars not working

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



##########
File path: python/pyarrow/tests/test_convert_builtin.py
##########
@@ -182,6 +182,19 @@ def test_sequence_numpy_boolean(seq):
     assert arr.to_pylist() == expected
 
 
+@parametrize_with_iterable_types
+def test_sequence_mixed_numpy_python_bools(seq):
+    values = np.array([True, False])
+    arr = pa.array(seq([values[0], None, values[1], True, False]))
+    assert len(arr) == 5
+    assert arr.null_count == 1
+    assert arr.type == pa.bool_()
+    assert arr[0].as_py() is True

Review comment:
       You can simply compare `arr.as_py()` ;-)




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