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

Source from the content-addressed store, hash-verified

4536@pytest.mark.numpy
4537@pytest.mark.parametrize('numpy_native_dtype', ['u2', 'i4', 'f8'])
4538def test_swapped_byte_order_fails(numpy_native_dtype):
4539 # ARROW-39129
4540
4541 numpy_swapped_dtype = np.dtype(numpy_native_dtype).newbyteorder()
4542 np_arr = np.arange(10, dtype=numpy_swapped_dtype)
4543
4544 # Primitive type array, type is inferred from the numpy array
4545 with pytest.raises(pa.ArrowNotImplementedError):
4546 pa.array(np_arr)
4547
4548 # Primitive type array, type is explicitly provided
4549 with pytest.raises(pa.ArrowNotImplementedError):
4550 pa.array(np_arr, type=pa.float64())
4551
4552 # List type array
4553 with pytest.raises(pa.ArrowNotImplementedError):
4554 pa.array([np_arr])
4555
4556 # Struct type array
4557 with pytest.raises(pa.ArrowNotImplementedError):
4558 pa.StructArray.from_arrays([np_arr], names=['a'])
4559
4560
4561def test_non_cpu_array():

Callers

nothing calls this directly

Calls 2

dtypeMethod · 0.80
arrayMethod · 0.45

Tested by

no test coverage detected