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

Function test_split_pattern_regex

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

Source from the content-addressed store, hash-verified

762
763
764def test_split_pattern_regex():
765 arr = pa.array(["-foo---bar--", "---foo---b"])
766 result = pc.split_pattern_regex(arr, pattern="-+")
767 expected = pa.array([["", "foo", "bar", ""], ["", "foo", "b"]])
768 assert expected.equals(result)
769
770 result = pc.split_pattern_regex(arr, "-+", max_splits=1)
771 expected = pa.array([["", "foo---bar--"], ["", "foo---b"]])
772 assert expected.equals(result)
773
774 with pytest.raises(NotImplementedError,
775 match="Cannot split in reverse with regex"):
776 result = pc.split_pattern_regex(
777 arr, pattern="---", max_splits=1, reverse=True)
778
779
780def test_min_max():

Callers

nothing calls this directly

Calls 2

equalsMethod · 0.80
arrayMethod · 0.45

Tested by

no test coverage detected