diff --git a/python/cudf/cudf/core/dataframe.py b/python/cudf/cudf/core/dataframe.py index fac4069356c..24ce2e10158 100644 --- a/python/cudf/cudf/core/dataframe.py +++ b/python/cudf/cudf/core/dataframe.py @@ -3001,10 +3001,10 @@ def agg(self, aggs, axis=None): elif all([isinstance(val, abc.Iterable) for val in aggs.values()]): idxs = set() for val in aggs.values(): - if isinstance(val, abc.Iterable): - idxs.update(val) - elif isinstance(val, str): + if isinstance(val, str): idxs.add(val) + elif isinstance(val, abc.Iterable): + idxs.update(val) idxs = sorted(list(idxs)) for agg in idxs: if agg is callable: