# Buggy code
def describe(self, **kwargs):
    """Generates descriptive statistics.

    Returns:
        DataFrame object containing the descriptive statistics of the DataFrame.
    """
    # Use pandas to calculate the correct columns
    empty_df = (
        pandas.DataFrame(columns=self.columns).astype(self.dtypes).describe(**kwargs)
    )

    def describe_builder(df, internal_indices=[]):
        return df.iloc[:, internal_indices].describe(**kwargs)

    return self.__constructor__(
        self._modin_frame._apply_full_axis_select_indices(
            0,
            describe_builder,
            empty_df.columns,
            new_index=empty_df.index,
            new_columns=empty_df.columns,
        )
    )


# Traceback (Exception)
df.describe()
---------------------------------------------------------------------------
Exception                                 Traceback (most recent call last)
/usr/lib/python3.8/site-packages/IPython/core/formatters.py in __call__(self, obj)
700                 type_pprinters=self.type_printers,
701                 deferred_pprinters=self.deferred_printers)
--> 702             printer.pretty(obj)
703             printer.flush()
704             return stream.getvalue()

/usr/lib/python3.8/site-packages/IPython/lib/pretty.py in pretty(self, obj)
392                         if cls is not object \
393                                 and callable(cls.__dict__.get('__repr__')):
--> 394                             return _repr_pprint(obj, self, cycle)
395
396             return _default_pprint(obj, self, cycle)

/usr/lib/python3.8/site-packages/IPython/lib/pretty.py in _repr_pprint(obj, p, cycle)
698     """A pprint that just redirects to the normal repr function."""
699     # Find newlines and replace them with p.break_()
--> 700     output = repr(obj)
701     lines = output.splitlines()
702     with p.group():

~/.local/lib/python3.8/site-packages/modin/pandas/dataframe.py in __repr__(self)
163
164             num_cols += len(self.columns) - i
--> 165         result = repr(self._build_repr_df(num_rows, num_cols))
166         if len(self.index) > num_rows or len(self.columns) > num_cols:
167             # The split here is so that we don't repr pandas row lengths.

~/.local/lib/python3.8/site-packages/modin/pandas/base.py in _build_repr_df(self, num_rows, num_cols)
106         else:
107             indexer = row_indexer
--> 108         return self.iloc[indexer]._query_compiler.to_pandas()
109
110     def _update_inplace(self, new_query_compiler):

~/.local/lib/python3.8/site-packages/modin/pandas/indexing.py in __getitem__(self, key)
377
378         row_lookup, col_lookup = self._compute_lookup(row_loc, col_loc)
--> 379         result = super(_iLocIndexer, self).__getitem__(row_lookup, col_lookup, ndim)
380         if isinstance(result, Series):
381             result._parent = self.df

~/.local/lib/python3.8/site-packages/modin/pandas/indexing.py in __getitem__(self, row_lookup, col_lookup, ndim)
128
129     def __getitem__(self, row_lookup, col_lookup, ndim):
--> 130         qc_view = self.qc.view(row_lookup, col_lookup)
131         if ndim == 2:
132             return self.df.__constructor__(query_compiler=qc_view)

~/.local/lib/python3.8/site-packages/modin/backends/pandas/query_compiler.py in view(self, index, columns)
2144     def view(self, index=None, columns=None):
2145         return self.__constructor__(
-> 2146             self._modin_frame.mask(row_numeric_idx=index, col_numeric_idx=columns)
2147         )
2148

~/.local/lib/python3.8/site-packages/modin/engines/base/frame/data.py in mask(self, row_indices, row_numeric_idx, col_indices, col_numeric_idx)
464             and col_numeric_idx is None
465         ):
--> 466             return self.copy()
467         if row_indices is not None:
468             row_numeric_idx = self.index.get_indexer_for(row_indices)

~/.local/lib/python3.8/site-packages/modin/engines/base/frame/data.py in copy(self)
635             A copied version of this object.
636         """
--> 637         return self.__constructor__(
638             self._partitions,
639             self.index.copy(),

~/.local/lib/python3.8/site-packages/modin/engines/base/frame/data.py in __init__(self, partitions, index, columns, row_lengths, column_widths, dtypes, validate_axes)
63         self._columns_cache = ensure_index(columns)
64         if row_lengths is not None and len(self.index) > 0:
---> 65             ErrorMessage.catch_bugs_and_request_email(
66                 sum(row_lengths) != len(self._index_cache),
67                 "Row lengths: {} != {}".format(

~/.local/lib/python3.8/site-packages/modin/error_message.py in catch_bugs_and_request_email(cls, failure_condition, extra_log)
49     def catch_bugs_and_request_email(cls, failure_condition, extra_log=""):
50         if failure_condition:
---> 51             raise Exception(
52                 "Internal Error. "
53                 "Please email bug_reports@modin.org with the traceback and command that"

Exception: Internal Error. Please email bug_reports@modin.org with the traceback and command that caused this error.
Row lengths: 6 != 4

---------------------------------------------------------------------------
Exception                                 Traceback (most recent call last)
/usr/lib/python3.8/site-packages/IPython/core/formatters.py in __call__(self, obj)
343             method = get_real_method(obj, self.print_method)
344             if method is not None:
--> 345                 return method()
346             return None
347         else:

~/.local/lib/python3.8/site-packages/modin/pandas/dataframe.py in _repr_html_(self)
184         # We use pandas _repr_html_ to get a string of the HTML representation
185         # of the dataframe.
--> 186         result = self._build_repr_df(num_rows, num_cols)._repr_html_()
187         if len(self.index) > num_rows or len(self.columns) > num_cols:
188             # We split so that we insert our correct dataframe dimensions.

~/.local/lib/python3.8/site-packages/modin/pandas/base.py in _build_repr_df(self, num_rows, num_cols)
106         else:
107             indexer = row_indexer
--> 108         return self.iloc[indexer]._query_compiler.to_pandas()
109
110     def _update_inplace(self, new_query_compiler):

~/.local/lib/python3.8/site-packages/modin/pandas/indexing.py in __getitem__(self, key)
377
378         row_lookup, col_lookup = self._compute_lookup(row_loc, col_loc)
--> 379         result = super(_iLocIndexer, self).__getitem__(row_lookup, col_lookup, ndim)
380         if isinstance(result, Series):
381             result._parent = self.df

~/.local/lib/python3.8/site-packages/modin/pandas/indexing.py in __getitem__(self, row_lookup, col_lookup, ndim)
128
129     def __getitem__(self, row_lookup, col_lookup, ndim):
--> 130         qc_view = self.qc.view(row_lookup, col_lookup)
131         if ndim == 2:
132             return self.df.__constructor__(query_compiler=qc_view)

~/.local/lib/python3.8/site-packages/modin/backends/pandas/query_compiler.py in view(self, index, columns)
2144     def view(self, index=None, columns=None):
2145         return self.__constructor__(
-> 2146             self._modin_frame.mask(row_numeric_idx=index, col_numeric_idx=columns)
2147         )
2148

~/.local/lib/python3.8/site-packages/modin/engines/base/frame/data.py in mask(self, row_indices, row_numeric_idx, col_indices, col_numeric_idx)
464             and col_numeric_idx is None
465         ):
--> 466             return self.copy()
467         if row_indices is not None:
468             row_numeric_idx = self.index.get_indexer_for(row_indices)

~/.local/lib/python3.8/site-packages/modin/engines/base/frame/data.py in copy(self)
635             A copied version of this object.
636         """
--> 637         return self.__constructor__(
638             self._partitions,
639             self.index.copy(),

~/.local/lib/python3.8/site-packages/modin/engines/base/frame/data.py in __init__(self, partitions, index, columns, row_lengths, column_widths, dtypes, validate_axes)
63         self._columns_cache = ensure_index(columns)
64         if row_lengths is not None and len(self.index) > 0:
---> 65             ErrorMessage.catch_bugs_and_request_email(
66                 sum(row_lengths) != len(self._index_cache),
67                 "Row lengths: {} != {}".format(

~/.local/lib/python3.8/site-packages/modin/error_message.py in catch_bugs_and_request_email(cls, failure_condition, extra_log)
49     def catch_bugs_and_request_email(cls, failure_condition, extra_log=""):
50         if failure_condition:
---> 51             raise Exception(
52                 "Internal Error. "
53                 "Please email bug_reports@modin.org with the traceback and command that"

Exception: Internal Error. Please email bug_reports@modin.org with the traceback and command that caused this error.
Row lengths: 6 != 4

# Fixed code
def describe(self, **kwargs):
    """Generates descriptive statistics.

    Returns:
        DataFrame object containing the descriptive statistics of the DataFrame.
    """
    # Use pandas to calculate the correct columns
    empty_df = (
        pandas.DataFrame(columns=self.columns).astype(self.dtypes).describe(**kwargs)
    )
    new_index = empty_df.index

    # Note: `describe` convert timestamp type to object type
    # which results in the loss of two values in index: `first` and `last`
    # for empty DataFrame.
    datetime_is_numeric = kwargs.get("datetime_is_numeric") or False
    if not any(map(is_numeric_dtype, empty_df.dtypes)) and not datetime_is_numeric:
        for col_name in empty_df.dtypes.index:
            # if previosly type of `col_name` was datetime or timedelta
            if is_datetime_or_timedelta_dtype(self.dtypes[col_name]):
                new_index = pandas.Index(
                    empty_df.index.to_list() + ["first"] + ["last"]
                )
                break

    def describe_builder(df, internal_indices=[]):
        return df.iloc[:, internal_indices].describe(**kwargs)

    return self.__constructor__(
        self._modin_frame._apply_full_axis_select_indices(
            0,
            describe_builder,
            empty_df.columns,
            new_index=new_index,
            new_columns=empty_df.columns,
        )
    )