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

Function test_string_py_compat_boolean

python/pyarrow/tests/test_compute.py:1134–1151  ·  view source on GitHub ↗
(function_name, variant)

Source from the content-addressed store, hash-verified

1132 'is_space', 'is_upper', ])
1133@pytest.mark.parametrize('variant', ['ascii', 'utf8'])
1134def test_string_py_compat_boolean(function_name, variant):
1135 arrow_name = variant + "_" + function_name
1136 py_name = function_name.replace('_', '')
1137 ignore = codepoints_ignore.get(function_name, set()) | \
1138 find_new_unicode_codepoints()
1139 for i in range(128 if ascii else 0x11000):
1140 if i in range(0xD800, 0xE000):
1141 continue # bug? pyarrow doesn't allow utf16 surrogates
1142 # the issues we know of, we skip
1143 if i in ignore:
1144 continue
1145 # Compare results with the equivalent Python predicate
1146 # (except "is_space" where functions are known to be incompatible)
1147 c = chr(i)
1148 if hasattr(pc, arrow_name) and function_name != 'is_space':
1149 ar = pa.array([c])
1150 arrow_func = getattr(pc, arrow_name)
1151 assert arrow_func(ar)[0].as_py() == getattr(c, py_name)()
1152
1153
1154def test_pad():

Callers

nothing calls this directly

Calls 4

as_pyMethod · 0.80
getMethod · 0.45
arrayMethod · 0.45

Tested by

no test coverage detected