1111
1212from __future__ import annotations
1313
14- from collections .abc import Callable
14+ from collections .abc import Callable , Sequence
1515from dataclasses import dataclass
1616from typing import Annotated , Any
1717
4040_INPUT_SCHEMA = make_schema ([pa .field ("n" , pa .int64 ())])
4141
4242
43- def _expected_pairs (counts : list [int | None ]) -> list [tuple [int , int ]]:
43+ def _expected_pairs (counts : Sequence [int | None ]) -> list [tuple [int , int ]]:
4444 return [(row , k ) for row , n in enumerate (counts ) for k in range (n or 0 )]
4545
4646
4747def _run_paged (
4848 client : Client ,
4949 monkeypatch : pytest .MonkeyPatch ,
50- batches : list [ list [int | None ]],
50+ batches : Sequence [ Sequence [int | None ]],
5151 page_size : int ,
5252) -> tuple [list [tuple [int , int ]], list [int ]]:
5353 """Run ``blended_paged``; return (parent_row, value) pairs and replies per input batch."""
@@ -66,12 +66,14 @@ def counting(self: Client, *args: Any, **kwargs: Any) -> Any:
6666 client .table_in_out_function (
6767 function_name = "blended_paged" ,
6868 schema_path = ["main" ],
69- input = iter ([pa .RecordBatch .from_pydict ({"n" : counts }, schema = _INPUT_SCHEMA ) for counts in batches ]),
69+ input = iter (
70+ [pa .RecordBatch .from_pydict ({"n" : list (counts )}, schema = _INPUT_SCHEMA ) for counts in batches ]
71+ ),
7072 arguments = Arguments (named = {"page_size" : pa .scalar (page_size )}),
7173 parent_row_callback = parent_rows_seen .extend ,
7274 )
7375 )
74- values = [v for batch in results for v in batch .column ("i" ).to_pylist ()]
76+ values : list [ Any ] = [v for batch in results for v in batch .column ("i" ).to_pylist ()]
7577 return list (zip (parent_rows_seen , values , strict = True )), replies
7678
7779
0 commit comments