# Buggy code
def groupby_reduce(
    self, axis, by, map_func, reduce_func, new_index=None, new_columns=None
):
    """Groupby another dataframe and aggregate the result.

    Args:
        axis: The axis to groupby and aggregate over.
        by: The dataframe to group by.
        map_func: The map component of the aggregation.
        reduce_func: The reduce component of the aggregation.
        new_index: (optional) The index of the result. We may know this in advance,
            and if not provided it must be computed.
        new_columns: (optional) The columns of the result. We may know this in
            advance, and if not provided it must be computed.

    Returns:
         A new dataframe.
    """
    new_partitions = self._frame_mgr_cls.groupby_reduce(
        axis, self._partitions, by._partitions, map_func, reduce_func
    )
    if new_columns is None:
        new_columns = self._frame_mgr_cls.get_indices(
            1, new_partitions, lambda df: df.columns
        )
    if new_index is None:
        new_index = self._frame_mgr_cls.get_indices(
            0, new_partitions, lambda df: df.index
        )
    if axis == 0:
        new_widths = self._column_widths
        new_lengths = None
    else:
        new_widths = None
        new_lengths = self._row_lengths
    return self.__constructor__(
        new_partitions, new_index, new_columns, new_lengths, new_widths
    )


# Traceback (ValueError)
Traceback (most recent call last):
File "/localdisk/gashiman/omniscripts/taxi/taxibench_pandas.py", line 190, in <module>
query(query_df)
File "/localdisk/gashiman/omniscripts/taxi/taxibench_pandas.py", line 95, in q3
return transformed.groupby(['passenger_count','pickup_datetime'])[['passenger_count','pickup_datetime']].count()['passenger_count']
File "/nfs/site/proj/scripting_tools/gashiman/modin/modin/pandas/groupby.py", line 249, in __getitem__
return SeriesGroupBy(self._default_to_pandas(lambda df: df.__getitem__(key)))
File "/nfs/site/proj/scripting_tools/gashiman/modin/modin/pandas/groupby.py", line 535, in _default_to_pandas
return self._df._default_to_pandas(groupby_on_multiple_columns)
File "/nfs/site/proj/scripting_tools/gashiman/modin/modin/pandas/base.py", line 227, in _default_to_pandas
result = op(pandas_obj, *args, **kwargs)
File "/nfs/site/proj/scripting_tools/gashiman/modin/modin/pandas/groupby.py", line 533, in groupby_on_multiple_columns
return f(df.groupby(by=by, axis=self._axis, **self._kwargs), **kwargs)
File "/nfs/site/home/gashiman/.local/lib/python3.7/site-packages/pandas/core/generic.py", line 7894, in groupby
**kwargs
File "/nfs/site/home/gashiman/.local/lib/python3.7/site-packages/pandas/core/groupby/groupby.py", line 2522, in groupby
return klass(obj, by, **kwds)
File "/nfs/site/home/gashiman/.local/lib/python3.7/site-packages/pandas/core/groupby/groupby.py", line 391, in __init__
mutated=self.mutated,
File "/nfs/site/home/gashiman/.local/lib/python3.7/site-packages/pandas/core/groupby/grouper.py", line 652, in _get_grouper
if not isinstance(gpr, Grouping)
File "/nfs/site/home/gashiman/.local/lib/python3.7/site-packages/pandas/core/groupby/grouper.py", line 347, in __init__
raise ValueError("Grouper for '{}' not 1-dimensional".format(t))
ValueError: Grouper for '<class 'pandas.core.frame.DataFrame'>' not 1-dimensional

# Fixed code
def groupby_reduce(
    self, axis, by, map_func, reduce_func, new_index=None, new_columns=None
):
    """Groupby another dataframe and aggregate the result.

    Args:
        axis: The axis to groupby and aggregate over.
        by: The dataframe to group by.
        map_func: The map component of the aggregation.
        reduce_func: The reduce component of the aggregation.
        new_index: (optional) The index of the result. We may know this in advance,
            and if not provided it must be computed.
        new_columns: (optional) The columns of the result. We may know this in
            advance, and if not provided it must be computed.

    Returns:
         A new dataframe.
    """
    new_partitions = self._frame_mgr_cls.groupby_reduce(
        axis, self._partitions, by._partitions, map_func, reduce_func
    )
    if new_columns is None:
        new_columns = self._frame_mgr_cls.get_indices(
            1, new_partitions, lambda df: df.columns
        )
    if new_index is None:
        new_index = self._frame_mgr_cls.get_indices(
            0, new_partitions, lambda df: df.index
        )
    return self.__constructor__(new_partitions, new_index, new_columns)