(self, key, descriptor, table)
| 43 | tuple(descriptor.path or tuple())) |
| 44 | |
| 45 | def _make_flight_info(self, key, descriptor, table): |
| 46 | if self.tls_certificates: |
| 47 | location = pyarrow.flight.Location.for_grpc_tls( |
| 48 | self.host, self.port) |
| 49 | else: |
| 50 | location = pyarrow.flight.Location.for_grpc_tcp( |
| 51 | self.host, self.port) |
| 52 | endpoints = [pyarrow.flight.FlightEndpoint(repr(key), [location]), ] |
| 53 | |
| 54 | mock_sink = pyarrow.MockOutputStream() |
| 55 | stream_writer = pyarrow.RecordBatchStreamWriter( |
| 56 | mock_sink, table.schema) |
| 57 | stream_writer.write_table(table) |
| 58 | stream_writer.close() |
| 59 | data_size = mock_sink.size() |
| 60 | |
| 61 | return pyarrow.flight.FlightInfo(table.schema, |
| 62 | descriptor, endpoints, |
| 63 | table.num_rows, data_size) |
| 64 | |
| 65 | def list_flights(self, context, criteria): |
| 66 | for key, table in self.flights.items(): |
no test coverage detected