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

Function test_chunked_array_slice

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

Source from the content-addressed store, hash-verified

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