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:1793–1811  ·  view source on GitHub ↗

Try a simple do_get call with metadata.

()

Source from the content-addressed store, hash-verified

1791
1792
1793def test_flight_do_get_metadata():
1794 """Try a simple do_get call with metadata."""
1795 data = [
1796 pa.array([-10, -5, 0, 5, 10])
1797 ]
1798 table = pa.Table.from_arrays(data, names=['a'])
1799
1800 batches = []
1801 with MetadataFlightServer() as server, \
1802 FlightClient(('localhost', server.port)) as client:
1803 reader = client.do_get(flight.Ticket(b''))
1804 idx = 0
1805 for batch, metadata in reader:
1806 batches.append(batch)
1807 server_idx, = struct.unpack('<i', metadata.to_pybytes())
1808 assert idx == server_idx
1809 idx += 1
1810 data = pa.Table.from_batches(batches)
1811 assert data.equals(table)
1812
1813
1814def 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