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

Method _make_flight_info

python/examples/flight/server.py:45–63  ·  view source on GitHub ↗
(self, key, descriptor, table)

Source from the content-addressed store, hash-verified

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():

Callers 2

list_flightsMethod · 0.95
get_flight_infoMethod · 0.95

Calls 4

write_tableMethod · 0.45
closeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected