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

Function test_slice_compatibility

python/pyarrow/tests/test_compute.py:680–692  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

678
679
680def test_slice_compatibility():
681 arr = pa.array(["", "𝑓", "𝑓ö", "𝑓öõ", "𝑓öõḍ", "𝑓öõḍš"])
682 for start in range(-6, 6):
683 for stop in itertools.chain(range(-6, 6), [None]):
684 for step in [-3, -2, -1, 1, 2, 3]:
685 expected = pa.array([k.as_py()[start:stop:step]
686 for k in arr])
687 result = pc.utf8_slice_codeunits(
688 arr, start=start, stop=stop, step=step)
689 assert expected.equals(result)
690 # Positional options
691 assert pc.utf8_slice_codeunits(arr,
692 start, stop, step) == result
693
694
695def test_binary_slice_compatibility():

Callers

nothing calls this directly

Calls 3

as_pyMethod · 0.80
equalsMethod · 0.80
arrayMethod · 0.45

Tested by

no test coverage detected