# 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)
    if len(new_columns) != 0:
        numeric = True
        exclude = kwargs.get("exclude", None)
        include = kwargs.get("include", 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.
        if include is None:
            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 is_list_like(exclude):
            exclude.append(add_to_excludes)
        else:
            exclude = add_to_excludes
        kwargs["exclude"] = exclude
    else:
        numeric = False
        # If only timedelta and datetime objects, only do the timedelta
        # columns
        if all(
            (
                dtype
                for dtype in self.dtypes
                if dtype == np.datetime64 or dtype == np.timedelta64
            )
        ):
            new_columns = [
                self.columns[i]
                for i in range(len(self.columns))
                if self.dtypes[i] != np.dtype("datetime64[ns]")
            ]
        else:
            # Describe all columns
            new_columns = self.columns

    def describe_builder(df, **kwargs):
        return pandas.DataFrame.describe(df, **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)
    if numeric:
        new_dtypes = pandas.Series([np.float64 for _ in new_columns], index=new_columns)
    else:
        new_dtypes = pandas.Series([np.object for _ in new_columns], index=new_columns)
    return self.__constructor__(new_data, new_index, new_columns, new_dtypes)


# Traceback (RayTaskError)
---------------------------------------------------------------------------
RayTaskError                              Traceback (most recent call last)
~/Downloads/kaggle5/kaggle5.py in <module>
51
52
---> 53 train_df.describe(include=['O'])
54
55 # In[9]:

~/software_builds/modin/modin/pandas/dataframe.py in describe(self, percentiles, include, exclude)
1093         return DataFrame(
1094             query_compiler=self._query_compiler.describe(
-> 1095                 percentiles=percentiles, include=include, exclude=exclude
1096             )
1097         )

~/software_builds/modin/modin/data_management/query_compiler/pandas_query_compiler.py in describe(self, **kwargs)
1601             func, 0, new_columns, False
1602         )
-> 1603         new_index = self.compute_index(0, new_data, False)
1604         if numeric:
1605             new_dtypes = pandas.Series(

~/software_builds/modin/modin/data_management/query_compiler/pandas_query_compiler.py in compute_index(self, axis, data_object, compute_diff)
136             axis=axis,
137             index_func=lambda df: pandas_index_extraction(df, axis),
--> 138             old_blocks=old_blocks,
139         )
140         return index_obj[new_indices] if compute_diff else new_indices

~/software_builds/modin/modin/engines/base/block_partitions.py in get_indices(self, axis, index_func, old_blocks)
514             new_indices = (
515                 [idx.apply(func).get() for idx in self._partitions_cache.T[0]]
--> 516                 if len(self._partitions_cache.T)
517                 else []
518             )

~/software_builds/modin/modin/engines/base/block_partitions.py in <listcomp>(.0)
513             # DO NOT CHANGE TO self.partitions under any circumstance.
514             new_indices = (
--> 515                 [idx.apply(func).get() for idx in self._partitions_cache.T[0]]
516                 if len(self._partitions_cache.T)
517                 else []

~/software_builds/modin/modin/engines/ray/pandas_on_ray/remote_partition.py in get(self)
26             return self.apply(lambda x: x).get()
27
---> 28         return ray.get(self.oid)
29
30     def apply(self, func, **kwargs):

/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/ray/worker.py in get(object_ids, worker)
2384                 # here.
2385                 last_task_error_raise_time = time.time()
-> 2386                 raise value
2387             return value
2388

RayTaskError: ray_worker:modin.engines.ray.pandas_on_ray.remote_partition.deploy_ray_func() (pid=17711, host=iMac.local)
ray.worker.RayTaskError: ray_worker:modin.engines.ray.pandas_on_ray.axis_partition.deploy_ray_axis_func() (pid=17712, host=iMac.local)
File "/Users/DevinPetersohn/software_builds/modin/modin/engines/ray/pandas_on_ray/axis_partition.py", line 127, in deploy_ray_axis_func
result = func(dataframe, **kwargs)
File "/Users/DevinPetersohn/software_builds/modin/modin/data_management/query_compiler/pandas_query_compiler.py", line 163, in helper
return pandas_func(df, **kwargs)
File "/Users/DevinPetersohn/software_builds/modin/modin/data_management/query_compiler/pandas_query_compiler.py", line 1596, in describe_builder
return pandas.DataFrame.describe(df, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pandas/core/generic.py", line 8585, in describe
d = pd.concat(ldesc, join_axes=pd.Index([names]), axis=1)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pandas/core/reshape/concat.py", line 225, in concat
copy=copy, sort=sort)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pandas/core/reshape/concat.py", line 259, in __init__
raise ValueError('No objects to concatenate')
ValueError: No objects to concatenate

# 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)
    if len(new_columns) != 0:
        numeric = True
        exclude = kwargs.get("exclude", None)
        include = kwargs.get("include", 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.
        if include is None:
            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 is_list_like(exclude):
            exclude.append(add_to_excludes)
        else:
            exclude = add_to_excludes
        kwargs["exclude"] = exclude
    else:
        numeric = False
        # If only timedelta and datetime objects, only do the timedelta
        # columns
        if all(
            (
                dtype
                for dtype in self.dtypes
                if dtype == np.datetime64 or dtype == np.timedelta64
            )
        ):
            new_columns = [
                self.columns[i]
                for i in range(len(self.columns))
                if self.dtypes[i] != np.dtype("datetime64[ns]")
            ]
        else:
            # Describe all columns
            new_columns = self.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)
    if numeric:
        new_dtypes = pandas.Series([np.float64 for _ in new_columns], index=new_columns)
    else:
        new_dtypes = pandas.Series([np.object for _ in new_columns], index=new_columns)
    return self.__constructor__(new_data, new_index, new_columns, new_dtypes)