Try a simple do_get call with metadata.
()
| 1791 | |
| 1792 | |
| 1793 | def 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 | |
| 1814 | def test_flight_metadata_record_batch_reader_iterator(): |
nothing calls this directly
no test coverage detected