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

Function test_doexchange_echo_v4

python/pyarrow/tests/test_flight.py:2330–2351  ·  view source on GitHub ↗

Try a DoExchange echo server using the V4 metadata version.

()

Source from the content-addressed store, hash-verified

2328
2329
2330def test_doexchange_echo_v4():
2331 """Try a DoExchange echo server using the V4 metadata version."""
2332 data = pa.Table.from_arrays([
2333 pa.array(range(0, 10 * 1024))
2334 ], names=["a"])
2335 batches = data.to_batches(max_chunksize=512)
2336
2337 options = pa.ipc.IpcWriteOptions(
2338 metadata_version=pa.ipc.MetadataVersion.V4)
2339 with ExchangeFlightServer(options=options) as server, \
2340 FlightClient(("localhost", server.port)) as client:
2341 descriptor = flight.FlightDescriptor.for_command(b"echo")
2342 writer, reader = client.do_exchange(descriptor)
2343 with writer:
2344 # Now write data without metadata.
2345 writer.begin(data.schema, options=options)
2346 for batch in batches:
2347 writer.write_batch(batch)
2348 assert reader.schema == data.schema
2349 chunk = reader.read_chunk()
2350 assert chunk.data == batch
2351 assert chunk.app_metadata is None
2352
2353
2354def test_doexchange_transform():

Callers

nothing calls this directly

Calls 7

FlightClientClass · 0.90
to_batchesMethod · 0.80
write_batchMethod · 0.80
arrayMethod · 0.45
do_exchangeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected