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

    Returns:
        DataFrame object containing the descriptive statistics of the DataFrame.
    """
    # Only describe numeric if there are numeric columns
    # Otherwise, describe all
    new_columns = self.numeric_columns(include_bool=False)
    include = kwargs.get("include", None)
    if len(new_columns) != 0 and include is not None:
        if not isinstance(include, np.dtype) and include == "all":
            new_columns = self.columns
        else:
            new_columns = self.dtypes[
                [
                    any(
                        (isinstance(inc, np.dtype) and inc == d)
                        or (
                            not isinstance(inc, np.dtype)
                            and inc.__subclasscheck__(getattr(np, d.__str__()))
                        )
                        for inc in include
                    )
                    for d in self.dtypes.values
                ]
            ].index
    elif len(new_columns) == 0:
        new_columns = [
            self.columns[i]
            for i in range(len(self.columns))
            if self.dtypes[i] != np.dtype("datetime64[ns]")
        ]
    else:
        exclude = kwargs.get("exclude", None)
        # This is done to check against the default dtypes with 'in'.
        # We don't change `include` in kwargs, so we can just use this for the
        # check.
        include = []
        default_excludes = [np.timedelta64, np.datetime64, np.object, np.bool]
        add_to_excludes = [e for e in default_excludes if e not in include]
        if isinstance(exclude, list):
            exclude.extend(add_to_excludes)
        else:
            exclude = add_to_excludes
        kwargs["exclude"] = exclude
        print(kwargs)
        # Update `new_columns` to reflect the included types
        new_columns = self.dtypes[~self.dtypes.isin(exclude)].index
        print(new_columns)

    def describe_builder(df, **kwargs):
        try:
            return pandas.DataFrame.describe(df, **kwargs)
        except ValueError:
            return pandas.DataFrame(index=df.index)

    # Apply describe and update indices, columns, and dtypes
    func = self._prepare_method(describe_builder, **kwargs)
    new_data = self._full_axis_reduce_along_select_indices(func, 0, new_columns, False)
    new_index = self.compute_index(0, new_data, False)
    return self.__constructor__(new_data, new_index, new_columns)


# Traceback (AssertionError)
---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
<ipython-input-5-7f2184cfd6d7> in <module>
2 df = pd.DataFrame(columns=cols)
3 for col in cols:
----> 4     df[col] = np.arange(10)

~/Documents/modin/modin/pandas/dataframe.py in __setitem__(self, key, value)
4605         else:
4606             loc = self.columns.get_loc(key)
-> 4607             self.__delitem__(key)
4608             self.insert(loc=loc, column=key, value=value)
4609

~/Documents/modin/modin/pandas/dataframe.py in __delitem__(self, key)
4690         if key not in self:
4691             raise KeyError(key)
-> 4692         self._update_inplace(new_query_compiler=self._query_compiler.delitem(key))
4693
4694     def __finalize__(self, other, method=None, **kwargs):

~/Documents/modin/modin/data_management/query_compiler/pandas_query_compiler.py in delitem(self, key)
2294     # These will change the shape of the resulting data.
2295     def delitem(self, key):
-> 2296         return self.drop(columns=[key])
2297
2298     def drop(self, index=None, columns=None):

~/Documents/modin/modin/data_management/query_compiler/pandas_query_compiler.py in drop(self, index, columns)
2336             new_columns = self.columns[~self.columns.isin(columns)]
2337             new_dtypes = self.dtypes.drop(columns)
-> 2338         return self.__constructor__(new_data, new_index, new_columns, new_dtypes)
2339
2340     # END __delitem__ and drop

~/Documents/modin/modin/data_management/query_compiler/pandas_query_compiler.py in __constructor__(self, block_paritions_object, index, columns, dtypes)
41     def __constructor__(self, block_paritions_object, index, columns, dtypes=None):
42         """By default, constructor method will invoke an init"""
---> 43         return type(self)(block_paritions_object, index, columns, dtypes)
44
45     # Index, columns and dtypes objects

~/Documents/modin/modin/data_management/query_compiler/pandas_query_compiler.py in __init__(self, block_partitions_object, index, columns, dtypes)
32         dtypes=None,
33     ):
---> 34         assert isinstance(block_partitions_object, BaseBlockPartitions)
35         self.data = block_partitions_object
36         self.index = index

AssertionError:

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

    Returns:
        DataFrame object containing the descriptive statistics of the DataFrame.
    """
    # Only describe numeric if there are numeric columns
    # Otherwise, describe all
    new_columns = self.numeric_columns(include_bool=False)
    include = kwargs.get("include", None)
    if len(new_columns) != 0 and include is not None:
        if not isinstance(include, np.dtype) and include == "all":
            new_columns = self.columns
        else:
            new_columns = self.dtypes[
                [
                    any(
                        (isinstance(inc, np.dtype) and inc == d)
                        or (
                            not isinstance(inc, np.dtype)
                            and inc.__subclasscheck__(getattr(np, d.__str__()))
                        )
                        for inc in include
                    )
                    for d in self.dtypes.values
                ]
            ].index
    elif len(new_columns) == 0:
        new_columns = [
            self.columns[i]
            for i in range(len(self.columns))
            if self.dtypes[i] != np.dtype("datetime64[ns]")
        ]
    else:
        exclude = kwargs.get("exclude", None)
        # This is done to check against the default dtypes with 'in'.
        # We don't change `include` in kwargs, so we can just use this for the
        # check.
        include = []
        default_excludes = [np.timedelta64, np.datetime64, np.object, np.bool]
        add_to_excludes = [e for e in default_excludes if e not in include]
        if isinstance(exclude, list):
            exclude.extend(add_to_excludes)
        else:
            exclude = add_to_excludes
        kwargs["exclude"] = exclude
        print(kwargs)
        # Update `new_columns` to reflect the included types
        new_columns = self.dtypes[~self.dtypes.isin(exclude)].index
        print(new_columns)

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

    # Apply describe and update indices, columns, and dtypes
    func = self._prepare_method(describe_builder, **kwargs)
    new_data = self._full_axis_reduce_along_select_indices(func, 0, new_columns, False)
    new_index = self.compute_index(0, new_data, False)
    return self.__constructor__(new_data, new_index, new_columns)