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

Source from the content-addressed store, hash-verified

4353@pytest.mark.numpy
4354@pytest.mark.parametrize('numpy_native_dtype', ['u2', 'i4', 'f8'])
4355def test_swapped_byte_order_fails(numpy_native_dtype):
4356 # ARROW-39129
4357
4358 numpy_swapped_dtype = np.dtype(numpy_native_dtype).newbyteorder()
4359 np_arr = np.arange(10, dtype=numpy_swapped_dtype)
4360
4361 # Primitive type array, type is inferred from the numpy array
4362 with pytest.raises(pa.ArrowNotImplementedError):
4363 pa.array(np_arr)
4364
4365 # Primitive type array, type is explicitly provided
4366 with pytest.raises(pa.ArrowNotImplementedError):
4367 pa.array(np_arr, type=pa.float64())
4368
4369 # List type array
4370 with pytest.raises(pa.ArrowNotImplementedError):
4371 pa.array([np_arr])
4372
4373 # Struct type array
4374 with pytest.raises(pa.ArrowNotImplementedError):
4375 pa.StructArray.from_arrays([np_arr], names=['a'])
4376
4377
4378def test_non_cpu_array():

Callers

nothing calls this directly

Calls 2

dtypeMethod · 0.80
arrayMethod · 0.45

Tested by

no test coverage detected