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

Function list_flights

python/examples/flight/client.py:28–63  ·  view source on GitHub ↗
(args, client, connection_args={})

Source from the content-addressed store, hash-verified

26
27
28def list_flights(args, client, connection_args={}):
29 print('Flights\n=======')
30 for flight in client.list_flights():
31 descriptor = flight.descriptor
32 if descriptor.descriptor_type == pyarrow.flight.DescriptorType.PATH:
33 print("Path:", descriptor.path)
34 elif descriptor.descriptor_type == pyarrow.flight.DescriptorType.CMD:
35 print("Command:", descriptor.command)
36 else:
37 print("Unknown descriptor type")
38
39 print("Total records:", end=" ")
40 if flight.total_records >= 0:
41 print(flight.total_records)
42 else:
43 print("Unknown")
44
45 print("Total bytes:", end=" ")
46 if flight.total_bytes >= 0:
47 print(flight.total_bytes)
48 else:
49 print("Unknown")
50
51 print(f"Data are {'ordered' if flight.ordered else 'not ordered'}")
52 print("App metadata:", flight.app_metadata)
53
54 print("Number of endpoints:", len(flight.endpoints))
55 print("Schema:")
56 print(flight.schema)
57 print('---')
58
59 print('\nActions\n=======')
60 for action in client.list_actions():
61 print("Type:", action.type)
62 print("Description:", action.description)
63 print('---')
64
65
66def do_action(args, client, connection_args={}):

Callers

nothing calls this directly

Calls 3

lenFunction · 0.85
list_flightsMethod · 0.45
list_actionsMethod · 0.45

Tested by

no test coverage detected