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

Function test_flight_get_info

python/pyarrow/tests/test_flight.py:1244–1264  ·  view source on GitHub ↗

Make sure FlightEndpoint accepts string and object URIs.

()

Source from the content-addressed store, hash-verified

1242
1243
1244def test_flight_get_info():
1245 """Make sure FlightEndpoint accepts string and object URIs."""
1246 with GetInfoFlightServer() as server:
1247 client = FlightClient(('localhost', server.port))
1248 info = client.get_flight_info(flight.FlightDescriptor.for_command(b''))
1249 assert info.total_records == 1
1250 assert info.total_bytes == 42
1251 assert info.ordered
1252 assert info.app_metadata == b"info app metadata"
1253 assert info.schema == pa.schema([('a', pa.int32())])
1254 assert len(info.endpoints) == 2
1255 assert len(info.endpoints[0].locations) == 1
1256 assert info.endpoints[0].expiration_time is None
1257 assert info.endpoints[0].app_metadata == b""
1258 assert info.endpoints[0].locations[0] == flight.Location('grpc://test')
1259 assert info.endpoints[1].expiration_time == \
1260 pa.scalar("2023-04-05T12:34:56.789012345+00:00") \
1261 .cast(pa.timestamp("ns", "UTC"))
1262 assert info.endpoints[1].app_metadata == b"endpoint app metadata"
1263 assert info.endpoints[1].locations[0] == \
1264 flight.Location.for_grpc_tcp('localhost', 5005)
1265
1266
1267def 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