(self, as_table=False)
| 89 | return pa.ipc.new_file(sink, schema, options=self.options) |
| 90 | |
| 91 | def _check_roundtrip(self, as_table=False): |
| 92 | batches = self.write_batches(as_table=as_table) |
| 93 | file_contents = pa.BufferReader(self.get_source()) |
| 94 | |
| 95 | reader = pa.ipc.open_file(file_contents) |
| 96 | |
| 97 | assert reader.num_record_batches == len(batches) |
| 98 | |
| 99 | for i, batch in enumerate(batches): |
| 100 | # it works. Must convert back to DataFrame |
| 101 | batch = reader.get_batch(i) |
| 102 | assert batches[i].equals(batch) |
| 103 | assert reader.schema.equals(batches[0].schema) |
| 104 | |
| 105 | assert isinstance(reader.stats, pa.ipc.ReadStats) |
| 106 | assert isinstance(self.write_stats, pa.ipc.WriteStats) |
| 107 | assert tuple(reader.stats) == tuple(self.write_stats) |
| 108 | |
| 109 | |
| 110 | class StreamFormatFixture(IpcFixture): |
no test coverage detected