Try a DoExchange echo server using the V4 metadata version.
()
| 2328 | |
| 2329 | |
| 2330 | def 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 | |
| 2354 | def test_doexchange_transform(): |
nothing calls this directly
no test coverage detected