@@ -420,7 +420,7 @@ def offset_labels(labels: np.ndarray, ngroups: int) -> tuple[np.ndarray, int]:
420
420
def factorize_ (
421
421
by : tuple ,
422
422
axis : T_AxesOpt ,
423
- expected_groups : tuple [pd .Index , ...] = None ,
423
+ expected_groups : tuple [pd .Index , ...] | None = None ,
424
424
reindex : bool = False ,
425
425
sort = True ,
426
426
fastpath = False ,
@@ -873,7 +873,7 @@ def _simple_combine(
873
873
return results
874
874
875
875
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 :
877
877
"""copied from dask.array.reductions.mean_combine"""
878
878
from dask .array .core import _concatenate2
879
879
from dask .utils import deepmap
@@ -1071,7 +1071,7 @@ def _reduce_blockwise(
1071
1071
return result
1072
1072
1073
1073
1074
- def _normalize_indexes (array , flatblocks , blkshape ):
1074
+ def _normalize_indexes (array : DaskArray , flatblocks , blkshape ) -> tuple :
1075
1075
"""
1076
1076
.blocks accessor can only accept one iterable at a time,
1077
1077
but can handle multiple slices.
@@ -1083,7 +1083,7 @@ def _normalize_indexes(array, flatblocks, blkshape):
1083
1083
"""
1084
1084
unraveled = np .unravel_index (flatblocks , blkshape )
1085
1085
1086
- normalized : list [Union [int , np . ndarray , slice ]] = []
1086
+ normalized : list [Union [int , slice , list [ int ] ]] = []
1087
1087
for ax , idx in enumerate (unraveled ):
1088
1088
i = _unique (idx ).squeeze ()
1089
1089
if i .ndim == 0 :
@@ -1397,7 +1397,7 @@ def dask_groupby_agg(
1397
1397
return (result , groups )
1398
1398
1399
1399
1400
- def _collapse_blocks_along_axes (reduced , axis , group_chunks ):
1400
+ def _collapse_blocks_along_axes (reduced : DaskArray , axis : T_Axes , group_chunks ) -> DaskArray :
1401
1401
import dask .array
1402
1402
from dask .highlevelgraph import HighLevelGraph
1403
1403
0 commit comments