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

Function test_swapped_byte_order_fails

python/pyarrow/tests/test_array.py:4296–4316  ·  view source on GitHub ↗
(numpy_native_dtype)

Source from the content-addressed store, hash-verified

4294@pytest.mark.numpy
4295@pytest.mark.parametrize('numpy_native_dtype', ['u2', 'i4', 'f8'])
4296def test_swapped_byte_order_fails(numpy_native_dtype):
4297 # ARROW-39129
4298
4299 numpy_swapped_dtype = np.dtype(numpy_native_dtype).newbyteorder()
4300 np_arr = np.arange(10, dtype=numpy_swapped_dtype)
4301
4302 # Primitive type array, type is inferred from the numpy array
4303 with pytest.raises(pa.ArrowNotImplementedError):
4304 pa.array(np_arr)
4305
4306 # Primitive type array, type is explicitly provided
4307 with pytest.raises(pa.ArrowNotImplementedError):
4308 pa.array(np_arr, type=pa.float64())
4309
4310 # List type array
4311 with pytest.raises(pa.ArrowNotImplementedError):
4312 pa.array([np_arr])
4313
4314 # Struct type array
4315 with pytest.raises(pa.ArrowNotImplementedError):
4316 pa.StructArray.from_arrays([np_arr], names=['a'])
4317
4318
4319def test_non_cpu_array():

Callers

nothing calls this directly

Calls 2

dtypeMethod · 0.80
arrayMethod · 0.45

Tested by

no test coverage detected