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

Function test_struct_array_slice

python/pyarrow/tests/test_array.py:721–727  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

719
720
721def test_struct_array_slice():
722 # ARROW-2311: slicing nested arrays needs special care
723 ty = pa.struct([pa.field('a', pa.int8()),
724 pa.field('b', pa.float32())])
725 arr = pa.array([(1, 2.5), (3, 4.5), (5, 6.5)], type=ty)
726 assert arr[1:].to_pylist() == [{'a': 3, 'b': 4.5},
727 {'a': 5, 'b': 6.5}]
728
729
730@pytest.mark.numpy

Callers

nothing calls this directly

Calls 2

fieldMethod · 0.45
arrayMethod · 0.45

Tested by

no test coverage detected