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:1139–1156  ·  view source on GitHub ↗
(function_name, variant)

Source from the content-addressed store, hash-verified

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