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

Function test_split_pattern

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

Source from the content-addressed store, hash-verified

717
718
719def test_split_pattern():
720 arr = pa.array(["-foo---bar--", "---foo---b"])
721 result = pc.split_pattern(arr, pattern="---")
722 expected = pa.array([["-foo", "bar--"], ["", "foo", "b"]])
723 assert expected.equals(result)
724
725 result = pc.split_pattern(arr, "---", max_splits=1)
726 expected = pa.array([["-foo", "bar--"], ["", "foo---b"]])
727 assert expected.equals(result)
728
729 result = pc.split_pattern(arr, "---", max_splits=1, reverse=True)
730 expected = pa.array([["-foo", "bar--"], ["---foo", "b"]])
731 assert expected.equals(result)
732
733
734def test_split_whitespace_utf8():

Callers

nothing calls this directly

Calls 2

equalsMethod · 0.80
arrayMethod · 0.45

Tested by

no test coverage detected