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

Function test_flight_do_get_metadata

python/pyarrow/tests/test_flight.py:1831–1849  ·  view source on GitHub ↗

Try a simple do_get call with metadata.

()

Source from the content-addressed store, hash-verified

1829
1830
1831def test_flight_do_get_metadata():
1832 """Try a simple do_get call with metadata."""
1833 data = [
1834 pa.array([-10, -5, 0, 5, 10])
1835 ]
1836 table = pa.Table.from_arrays(data, names=['a'])
1837
1838 batches = []
1839 with MetadataFlightServer() as server, \
1840 FlightClient(('localhost', server.port)) as client:
1841 reader = client.do_get(flight.Ticket(b''))
1842 idx = 0
1843 for batch, metadata in reader:
1844 batches.append(batch)
1845 server_idx, = struct.unpack('<i', metadata.to_pybytes())
1846 assert idx == server_idx
1847 idx += 1
1848 data = pa.Table.from_batches(batches)
1849 assert data.equals(table)
1850
1851
1852def test_flight_metadata_record_batch_reader_iterator():

Callers

nothing calls this directly

Calls 7

FlightClientClass · 0.90
equalsMethod · 0.80
arrayMethod · 0.45
do_getMethod · 0.45
appendMethod · 0.45
unpackMethod · 0.45

Tested by

no test coverage detected