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

Function test_chunked_array_slice

python/pyarrow/tests/test_table.py:208–229  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

206
207
208def test_chunked_array_slice():
209 data = [
210 pa.array([1, 2, 3]),
211 pa.array([4, 5, 6])
212 ]
213 data = pa.chunked_array(data)
214
215 data_slice = data.slice(len(data))
216 assert data_slice.type == data.type
217 assert data_slice.to_pylist() == []
218
219 data_slice = data.slice(len(data) + 10)
220 assert data_slice.type == data.type
221 assert data_slice.to_pylist() == []
222
223 table = pa.Table.from_arrays([data], names=["a"])
224 table_slice = table.slice(len(table))
225 assert len(table_slice) == 0
226
227 table = pa.Table.from_arrays([data], names=["a"])
228 table_slice = table.slice(len(table) + 10)
229 assert len(table_slice) == 0
230
231
232def test_chunked_array_iter():

Callers

nothing calls this directly

Calls 4

lenFunction · 0.85
chunked_arrayMethod · 0.80
arrayMethod · 0.45
sliceMethod · 0.45

Tested by

no test coverage detected