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

Function test_pad

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

Source from the content-addressed store, hash-verified

1157
1158
1159def test_pad():
1160 arr = pa.array([None, 'a', 'abcd'])
1161 assert pc.ascii_center(arr, width=3).tolist() == [None, ' a ', 'abcd']
1162 assert pc.ascii_lpad(arr, width=3).tolist() == [None, ' a', 'abcd']
1163 assert pc.ascii_rpad(arr, width=3).tolist() == [None, 'a ', 'abcd']
1164 assert pc.ascii_center(arr, 3).tolist() == [None, ' a ', 'abcd']
1165 assert pc.ascii_lpad(arr, 3).tolist() == [None, ' a', 'abcd']
1166 assert pc.ascii_rpad(arr, 3).tolist() == [None, 'a ', 'abcd']
1167
1168 arr = pa.array([None, 'á', 'abcd'])
1169 assert pc.utf8_center(arr, width=3).tolist() == [None, ' á ', 'abcd']
1170 assert pc.utf8_lpad(arr, width=3).tolist() == [None, ' á', 'abcd']
1171 assert pc.utf8_rpad(arr, width=3).tolist() == [None, 'á ', 'abcd']
1172 assert pc.utf8_center(arr, 3).tolist() == [None, ' á ', 'abcd']
1173 assert pc.utf8_lpad(arr, 3).tolist() == [None, ' á', 'abcd']
1174 assert pc.utf8_rpad(arr, 3).tolist() == [None, 'á ', 'abcd']
1175
1176
1177def test_utf8_zfill():

Callers

nothing calls this directly

Calls 1

arrayMethod · 0.45

Tested by

no test coverage detected