(args, client, connection_args={})
| 26 | |
| 27 | |
| 28 | def 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 | |
| 66 | def do_action(args, client, connection_args={}): |
nothing calls this directly
no test coverage detected