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

Function test_count_substring

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

Source from the content-addressed store, hash-verified

566
567
568def test_count_substring():
569 for (ty, offset) in [(pa.string(), pa.int32()),
570 (pa.large_string(), pa.int64())]:
571 arr = pa.array(["ab", "cab", "abcab", "ba", "AB", None], type=ty)
572
573 result = pc.count_substring(arr, "ab")
574 expected = pa.array([1, 1, 2, 0, 0, None], type=offset)
575 assert expected == result
576
577 result = pc.count_substring(arr, "ab", ignore_case=True)
578 expected = pa.array([1, 1, 2, 0, 1, None], type=offset)
579 assert expected == result
580
581
582def test_count_substring_regex():

Callers

nothing calls this directly

Calls 2

stringMethod · 0.45
arrayMethod · 0.45

Tested by

no test coverage detected