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

Function test_doexchange_echo_v4

python/pyarrow/tests/test_flight.py:2292–2313  ·  view source on GitHub ↗

Try a DoExchange echo server using the V4 metadata version.

()

Source from the content-addressed store, hash-verified

2290
2291
2292def test_doexchange_echo_v4():
2293 """Try a DoExchange echo server using the V4 metadata version."""
2294 data = pa.Table.from_arrays([
2295 pa.array(range(0, 10 * 1024))
2296 ], names=["a"])
2297 batches = data.to_batches(max_chunksize=512)
2298
2299 options = pa.ipc.IpcWriteOptions(
2300 metadata_version=pa.ipc.MetadataVersion.V4)
2301 with ExchangeFlightServer(options=options) as server, \
2302 FlightClient(("localhost", server.port)) as client:
2303 descriptor = flight.FlightDescriptor.for_command(b"echo")
2304 writer, reader = client.do_exchange(descriptor)
2305 with writer:
2306 # Now write data without metadata.
2307 writer.begin(data.schema, options=options)
2308 for batch in batches:
2309 writer.write_batch(batch)
2310 assert reader.schema == data.schema
2311 chunk = reader.read_chunk()
2312 assert chunk.data == batch
2313 assert chunk.app_metadata is None
2314
2315
2316def 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