@@ -1602,7 +1602,7 @@ def dask_groupby_agg(
1602
1602
engine : T_Engine = "numpy" ,
1603
1603
sort : bool = True ,
1604
1604
chunks_cohorts = None ,
1605
- ) -> tuple [DaskArray , tuple [np .ndarray | DaskArray ]]:
1605
+ ) -> tuple [DaskArray , tuple [pd . Index | np .ndarray | DaskArray ]]:
1606
1606
import dask .array
1607
1607
from dask .array .core import slices_from_chunks
1608
1608
from dask .highlevelgraph import HighLevelGraph
@@ -1730,7 +1730,7 @@ def dask_groupby_agg(
1730
1730
group_chunks = ((np .nan ,),)
1731
1731
else :
1732
1732
assert expected_groups is not None
1733
- groups = (expected_groups . to_numpy () ,)
1733
+ groups = (expected_groups ,)
1734
1734
group_chunks = ((len (expected_groups ),),)
1735
1735
1736
1736
elif method == "cohorts" :
@@ -1846,7 +1846,7 @@ def cubed_groupby_agg(
1846
1846
engine : T_Engine = "numpy" ,
1847
1847
sort : bool = True ,
1848
1848
chunks_cohorts = None ,
1849
- ) -> tuple [CubedArray , tuple [np .ndarray | CubedArray ]]:
1849
+ ) -> tuple [CubedArray , tuple [pd . Index | np .ndarray | CubedArray ]]:
1850
1850
import cubed
1851
1851
import cubed .core .groupby
1852
1852
@@ -1882,7 +1882,7 @@ def _reduction_func(a, by, axis, start_group, num_groups):
1882
1882
result = cubed .core .groupby .groupby_blockwise (
1883
1883
array , by , axis = axis , func = _reduction_func , num_groups = num_groups
1884
1884
)
1885
- groups = (expected_groups . to_numpy () ,)
1885
+ groups = (expected_groups ,)
1886
1886
return (result , groups )
1887
1887
1888
1888
else :
@@ -1964,7 +1964,7 @@ def _groupby_aggregate(a, **kwargs):
1964
1964
num_groups = num_groups ,
1965
1965
)
1966
1966
1967
- groups = (expected_groups . to_numpy () ,)
1967
+ groups = (expected_groups ,)
1968
1968
1969
1969
return (result , groups )
1970
1970
0 commit comments