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:4413–4433  ·  view source on GitHub ↗
(numpy_native_dtype)

Source from the content-addressed store, hash-verified

4411@pytest.mark.numpy
4412@pytest.mark.parametrize('numpy_native_dtype', ['u2', 'i4', 'f8'])
4413def test_swapped_byte_order_fails(numpy_native_dtype):
4414 # ARROW-39129
4415
4416 numpy_swapped_dtype = np.dtype(numpy_native_dtype).newbyteorder()
4417 np_arr = np.arange(10, dtype=numpy_swapped_dtype)
4418
4419 # Primitive type array, type is inferred from the numpy array
4420 with pytest.raises(pa.ArrowNotImplementedError):
4421 pa.array(np_arr)
4422
4423 # Primitive type array, type is explicitly provided
4424 with pytest.raises(pa.ArrowNotImplementedError):
4425 pa.array(np_arr, type=pa.float64())
4426
4427 # List type array
4428 with pytest.raises(pa.ArrowNotImplementedError):
4429 pa.array([np_arr])
4430
4431 # Struct type array
4432 with pytest.raises(pa.ArrowNotImplementedError):
4433 pa.StructArray.from_arrays([np_arr], names=['a'])
4434
4435
4436def test_non_cpu_array():

Callers

nothing calls this directly

Calls 2

dtypeMethod · 0.80
arrayMethod · 0.45

Tested by

no test coverage detected