Try a simple do_get call.
()
| 1214 | |
| 1215 | |
| 1216 | def test_flight_do_get_ints(): |
| 1217 | """Try a simple do_get call.""" |
| 1218 | table = simple_ints_table() |
| 1219 | |
| 1220 | with ConstantFlightServer() as server, \ |
| 1221 | flight.connect(('localhost', server.port)) as client: |
| 1222 | data = client.do_get(flight.Ticket(b'ints')).read_all() |
| 1223 | assert data.equals(table) |
| 1224 | |
| 1225 | options = pa.ipc.IpcWriteOptions( |
| 1226 | metadata_version=pa.ipc.MetadataVersion.V4) |
| 1227 | with ConstantFlightServer(options=options) as server, \ |
| 1228 | flight.connect(('localhost', server.port)) as client: |
| 1229 | data = client.do_get(flight.Ticket(b'ints')).read_all() |
| 1230 | assert data.equals(table) |
| 1231 | |
| 1232 | # Also test via RecordBatchReader interface |
| 1233 | data = client.do_get(flight.Ticket(b'ints')).to_reader().read_all() |
| 1234 | assert data.equals(table) |
| 1235 | |
| 1236 | with pytest.raises(flight.FlightServerError, |
| 1237 | match="expected IpcWriteOptions, got <class 'int'>"): |
| 1238 | with ConstantFlightServer(options=42) as server, \ |
| 1239 | flight.connect(('localhost', server.port)) as client: |
| 1240 | data = client.do_get(flight.Ticket(b'ints')).read_all() |
| 1241 | |
| 1242 | |
| 1243 | @pytest.mark.pandas |
nothing calls this directly
no test coverage detected