Try a simple do_get call with metadata.
()
| 1829 | |
| 1830 | |
| 1831 | def 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 | |
| 1852 | def test_flight_metadata_record_batch_reader_iterator(): |
nothing calls this directly
no test coverage detected