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:1178–1202  ·  view source on GitHub ↗

Try a simple do_get call.

()

Source from the content-addressed store, hash-verified

1176
1177
1178def 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

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