def _maybe_slice(grouped, columns):
    if isinstance(grouped, pd.core.groupby.DataFrameGroupBy):
        if columns is not None:
            return grouped[columns]
    return grouped
Slice columns if grouped is pd.DataFrameGroupBy
dataset/ETHPy150Open dask/dask/dask/dataframe/groupby.py/_maybe_slice