| 4039 | |
| 4040 | @pytest.mark.parametrize("wrapper_class", [ArrayWrapper, ArrayDeviceWrapper]) |
| 4041 | def 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 | |
| 4053 | def test_c_array_protocol_device_unsupported_keyword(): |