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