MCPcopy Create free account
hub / github.com/apache/arrow / test_chunked_array_to_numpy_zero_copy

Function test_chunked_array_to_numpy_zero_copy

python/pyarrow/tests/test_array.py:200–212  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

198
199@pytest.mark.numpy
200def test_chunked_array_to_numpy_zero_copy():
201 elements = [[2, 2, 4], [4, 5, 100]]
202
203 chunked_arr = pa.chunked_array(elements)
204
205 msg = "zero_copy_only must be False for pyarrow.ChunkedArray.to_numpy"
206
207 with pytest.raises(ValueError, match=msg):
208 chunked_arr.to_numpy(zero_copy_only=True)
209
210 np_arr = chunked_arr.to_numpy()
211 expected = [2, 2, 4, 4, 5, 100]
212 np.testing.assert_array_equal(np_arr, expected)
213
214
215@pytest.mark.numpy

Callers

nothing calls this directly

Calls 1

chunked_arrayMethod · 0.80

Tested by

no test coverage detected