| 187 | options=self.options) |
| 188 | |
| 189 | def do_put(self, context, descriptor, reader, writer): |
| 190 | counter = 0 |
| 191 | expected_data = [-10, -5, 0, 5, 10] |
| 192 | assert reader.stats.num_messages == 1 |
| 193 | for batch, buf in reader: |
| 194 | assert batch.equals(pa.RecordBatch.from_arrays( |
| 195 | [pa.array([expected_data[counter]])], |
| 196 | ['a'] |
| 197 | )) |
| 198 | assert buf is not None |
| 199 | client_counter, = struct.unpack('<i', buf.to_pybytes()) |
| 200 | assert counter == client_counter |
| 201 | writer.write(struct.pack('<i', counter)) |
| 202 | counter += 1 |
| 203 | assert reader.stats.num_messages == 6 |
| 204 | assert reader.stats.num_record_batches == 5 |
| 205 | |
| 206 | @staticmethod |
| 207 | def number_batches(table): |