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

Function test_replace_plain

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

Source from the content-addressed store, hash-verified

1231
1232
1233def test_replace_plain():
1234 data = pa.array(['foozfoo', 'food', None])
1235 ar = pc.replace_substring(data, pattern='foo', replacement='bar')
1236 assert ar.tolist() == ['barzbar', 'bard', None]
1237 ar = pc.replace_substring(data, 'foo', 'bar')
1238 assert ar.tolist() == ['barzbar', 'bard', None]
1239
1240 ar = pc.replace_substring(data, pattern='foo', replacement='bar',
1241 max_replacements=1)
1242 assert ar.tolist() == ['barzfoo', 'bard', None]
1243 ar = pc.replace_substring(data, 'foo', 'bar', max_replacements=1)
1244 assert ar.tolist() == ['barzfoo', 'bard', None]
1245
1246
1247def test_replace_regex():

Callers

nothing calls this directly

Calls 1

arrayMethod · 0.45

Tested by

no test coverage detected