jjerphan commented on code in PR #35582:
URL: https://github.com/apache/arrow/pull/35582#discussion_r1257453294
##########
python/pyarrow/tests/test_array.py:
##########
@@ -168,6 +168,28 @@ def test_to_numpy_zero_copy():
np.testing.assert_array_equal(np_arr, expected)
+def test_chunked_array_to_numpy_zero_copy():
+ elements = [[2, 2, 4], [4, 5, 100]]
+
+ chunked_arr = pa.chunked_array(elements)
+
+ msg = "zero_copy_only must be False for pyarrow.ChunkedArray.to_numpy"
+
+ with pytest.raises(ValueError, match=msg):
+ chunked_arr.to_numpy(zero_copy_only=True)
+
+ np_arr = chunked_arr.to_numpy()
+
+ chunked_arr = None
+ import gc
+ gc.collect()
+
+ # Ensure base is still valid
+ assert np_arr.base is not None
Review Comment:
OK, so we do not want to test the presence of `np_arr.base` here?
--
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]