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

Function test_c_array_protocol

python/pyarrow/tests/test_array.py:4041–4050  ·  view source on GitHub ↗
(wrapper_class)

Source from the content-addressed store, hash-verified

4039
4040@pytest.mark.parametrize("wrapper_class", [ArrayWrapper, ArrayDeviceWrapper])
4041def test_c_array_protocol(wrapper_class):
4042
4043 # Can roundtrip through the C array protocol
4044 arr = wrapper_class(pa.array([1, 2, 3], type=pa.int64()))
4045 result = pa.array(arr)
4046 assert result == arr.data
4047
4048 # Will cast to requested type
4049 result = pa.array(arr, type=pa.int32())
4050 assert result == pa.array([1, 2, 3], type=pa.int32())
4051
4052
4053def test_c_array_protocol_device_unsupported_keyword():

Callers

nothing calls this directly

Calls 1

arrayMethod · 0.45

Tested by

no test coverage detected