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

Function test_flight_get_info

python/pyarrow/tests/test_flight.py:1282–1302  ·  view source on GitHub ↗

Make sure FlightEndpoint accepts string and object URIs.

()

Source from the content-addressed store, hash-verified

1280
1281
1282def test_flight_get_info():
1283 """Make sure FlightEndpoint accepts string and object URIs."""
1284 with GetInfoFlightServer() as server:
1285 client = FlightClient(('localhost', server.port))
1286 info = client.get_flight_info(flight.FlightDescriptor.for_command(b''))
1287 assert info.total_records == 1
1288 assert info.total_bytes == 42
1289 assert info.ordered
1290 assert info.app_metadata == b"info app metadata"
1291 assert info.schema == pa.schema([('a', pa.int32())])
1292 assert len(info.endpoints) == 2
1293 assert len(info.endpoints[0].locations) == 1
1294 assert info.endpoints[0].expiration_time is None
1295 assert info.endpoints[0].app_metadata == b""
1296 assert info.endpoints[0].locations[0] == flight.Location('grpc://test')
1297 assert info.endpoints[1].expiration_time == \
1298 pa.scalar("2023-04-05T12:34:56.789012345+00:00") \
1299 .cast(pa.timestamp("ns", "UTC"))
1300 assert info.endpoints[1].app_metadata == b"endpoint app metadata"
1301 assert info.endpoints[1].locations[0] == \
1302 flight.Location.for_grpc_tcp('localhost', 5005)
1303
1304
1305def test_flight_get_schema():

Callers

nothing calls this directly

Calls 8

FlightClientClass · 0.90
GetInfoFlightServerClass · 0.85
lenFunction · 0.85
LocationMethod · 0.80
get_flight_infoMethod · 0.45
schemaMethod · 0.45
castMethod · 0.45
scalarMethod · 0.45

Tested by

no test coverage detected