Try a simple do_get call.
()
| 1176 | |
| 1177 | |
| 1178 | def test_flight_do_get_ints(): |
| 1179 | """Try a simple do_get call.""" |
| 1180 | table = simple_ints_table() |
| 1181 | |
| 1182 | with ConstantFlightServer() as server, \ |
| 1183 | flight.connect(('localhost', server.port)) as client: |
| 1184 | data = client.do_get(flight.Ticket(b'ints')).read_all() |
| 1185 | assert data.equals(table) |
| 1186 | |
| 1187 | options = pa.ipc.IpcWriteOptions( |
| 1188 | metadata_version=pa.ipc.MetadataVersion.V4) |
| 1189 | with ConstantFlightServer(options=options) as server, \ |
| 1190 | flight.connect(('localhost', server.port)) as client: |
| 1191 | data = client.do_get(flight.Ticket(b'ints')).read_all() |
| 1192 | assert data.equals(table) |
| 1193 | |
| 1194 | # Also test via RecordBatchReader interface |
| 1195 | data = client.do_get(flight.Ticket(b'ints')).to_reader().read_all() |
| 1196 | assert data.equals(table) |
| 1197 | |
| 1198 | with pytest.raises(flight.FlightServerError, |
| 1199 | match="expected IpcWriteOptions, got <class 'int'>"): |
| 1200 | with ConstantFlightServer(options=42) as server, \ |
| 1201 | flight.connect(('localhost', server.port)) as client: |
| 1202 | data = client.do_get(flight.Ticket(b'ints')).read_all() |
| 1203 | |
| 1204 | |
| 1205 | @pytest.mark.pandas |
nothing calls this directly
no test coverage detected