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

Function test_flight_do_get_ints

python/pyarrow/tests/test_flight.py:1216–1240  ·  view source on GitHub ↗

Try a simple do_get call.

()

Source from the content-addressed store, hash-verified

1214
1215
1216def 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

Callers

nothing calls this directly

Calls 4

simple_ints_tableFunction · 0.85
equalsMethod · 0.80
do_getMethod · 0.45

Tested by

no test coverage detected