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

Function test_file_count_rows

python/pyarrow/tests/test_ipc.py:192–202  ·  view source on GitHub ↗
(file_fixture)

Source from the content-addressed store, hash-verified

190
191
192def test_file_count_rows(file_fixture):
193 batches = file_fixture.write_batches()
194 file_contents = pa.BufferReader(file_fixture.get_source())
195
196 reader = pa.ipc.open_file(file_contents)
197
198 expected = sum(batch.num_rows for batch in batches)
199 assert reader.count_rows() == expected
200 # counting the rows does not consume the reader
201 assert reader.read_all().num_rows == expected
202 assert reader.count_rows() == expected
203
204
205def test_file_count_rows_no_batches():

Callers

nothing calls this directly

Calls 4

write_batchesMethod · 0.80
BufferReaderMethod · 0.80
get_sourceMethod · 0.80
count_rowsMethod · 0.80

Tested by

no test coverage detected