Skip to content

Commit

Permalink
fetch correct grouping keys
Browse files Browse the repository at this point in the history
  • Loading branch information
galipremsagar committed Aug 12, 2021
1 parent e3f35af commit ad7f2b2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion python/dask_cudf/dask_cudf/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
from dask.dataframe.groupby import DataFrameGroupBy, SeriesGroupBy
from dask.highlevelgraph import HighLevelGraph

import cudf


class CudfDataFrameGroupBy(DataFrameGroupBy):
def __init__(self, *args, **kwargs):
Expand Down Expand Up @@ -79,9 +81,14 @@ def aggregate(self, arg, split_every=None, split_out=1):
and isinstance(self.index, (str, list))
and _is_supported(arg, _supported)
):
if isinstance(self._meta.grouping.keys, cudf.MultiIndex):
keys = self._meta.grouping.keys.names
else:
keys = self._meta.grouping.keys.name

return groupby_agg(
self.obj,
self.index,
keys,
arg,
split_every=split_every,
split_out=split_out,
Expand Down

0 comments on commit ad7f2b2

Please sign in to comment.