(function_name, variant)
| 1132 | 'is_space', 'is_upper', ]) |
| 1133 | @pytest.mark.parametrize('variant', ['ascii', 'utf8']) |
| 1134 | def 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 | |
| 1154 | def test_pad(): |
nothing calls this directly
no test coverage detected