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

Function test_count_substring_regex

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

Source from the content-addressed store, hash-verified

580
581
582def test_count_substring_regex():
583 for (ty, offset) in [(pa.string(), pa.int32()),
584 (pa.large_string(), pa.int64())]:
585 arr = pa.array(["ab", "cab", "baAacaa", "ba", "AB", None], type=ty)
586
587 result = pc.count_substring_regex(arr, "a+")
588 expected = pa.array([1, 1, 3, 1, 0, None], type=offset)
589 assert expected.equals(result)
590
591 result = pc.count_substring_regex(arr, "a+", ignore_case=True)
592 expected = pa.array([1, 1, 2, 1, 1, None], type=offset)
593 assert expected.equals(result)
594
595
596def test_find_substring():

Callers

nothing calls this directly

Calls 3

equalsMethod · 0.80
stringMethod · 0.45
arrayMethod · 0.45

Tested by

no test coverage detected