@@ -420,7 +420,7 @@ def offset_labels(labels: np.ndarray, ngroups: int) -> tuple[np.ndarray, int]:
420420def factorize_ (
421421 by : tuple ,
422422 axis : T_AxesOpt ,
423- expected_groups : tuple [pd .Index , ...] = None ,
423+ expected_groups : tuple [pd .Index , ...] | None = None ,
424424 reindex : bool = False ,
425425 sort = True ,
426426 fastpath = False ,
@@ -873,7 +873,7 @@ def _simple_combine(
873873 return results
874874
875875
876- def _conc2 (x_chunk , key1 , key2 = slice (None ), axis : T_Axes = None ) -> np .ndarray :
876+ def _conc2 (x_chunk , key1 , key2 = slice (None ), axis : T_Axes | None = None ) -> np .ndarray :
877877 """copied from dask.array.reductions.mean_combine"""
878878 from dask .array .core import _concatenate2
879879 from dask .utils import deepmap
@@ -1071,7 +1071,7 @@ def _reduce_blockwise(
10711071 return result
10721072
10731073
1074- def _normalize_indexes (array , flatblocks , blkshape ):
1074+ def _normalize_indexes (array : DaskArray , flatblocks , blkshape ) -> tuple :
10751075 """
10761076 .blocks accessor can only accept one iterable at a time,
10771077 but can handle multiple slices.
@@ -1083,7 +1083,7 @@ def _normalize_indexes(array, flatblocks, blkshape):
10831083 """
10841084 unraveled = np .unravel_index (flatblocks , blkshape )
10851085
1086- normalized : list [Union [int , np . ndarray , slice ]] = []
1086+ normalized : list [Union [int , slice , list [ int ] ]] = []
10871087 for ax , idx in enumerate (unraveled ):
10881088 i = _unique (idx ).squeeze ()
10891089 if i .ndim == 0 :
@@ -1397,7 +1397,7 @@ def dask_groupby_agg(
13971397 return (result , groups )
13981398
13991399
1400- def _collapse_blocks_along_axes (reduced , axis , group_chunks ):
1400+ def _collapse_blocks_along_axes (reduced : DaskArray , axis : T_Axes , group_chunks ) -> DaskArray :
14011401 import dask .array
14021402 from dask .highlevelgraph import HighLevelGraph
14031403
0 commit comments