(file_fixture)
| 190 | |
| 191 | |
| 192 | def 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 | |
| 205 | def test_file_count_rows_no_batches(): |
nothing calls this directly
no test coverage detected