Skip to content

Commit 365af2f

Browse files
committed
FIX-#2195: add test
Signed-off-by: Anatoly Myachev <anatoly.myachev@intel.com>
1 parent 7db59fe commit 365af2f

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

modin/backends/pandas/query_compiler.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
from modin.backends.base.query_compiler import BaseQueryCompiler
2828
from modin.error_message import ErrorMessage
2929
from modin.utils import try_cast_to_pandas, wrap_udf_function
30-
from modin.pandas import Index
30+
31+
# from modin.pandas import Index
3132
from modin.data_management.functions import (
3233
FoldFunction,
3334
MapFunction,
@@ -1570,7 +1571,8 @@ def describe(self, **kwargs):
15701571
for col_name in empty_df.dtypes.index:
15711572
# if previosly type of `col_name` was datetime or timedelta
15721573
if is_datetime_or_timedelta_dtype(self.dtypes[col_name]):
1573-
new_index = Index(empty_df.index.to_list() + ["first"] + ["last"])
1574+
pass
1575+
# new_index = Index(empty_df.index.to_list() + ["first"] + ["last"])
15741576

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

modin/pandas/test/dataframe/test_reduction.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,22 @@ def test_describe(data, percentiles):
140140
)
141141

142142

143+
@pytest.mark.parametrize("datetime_is_numeric", [True, False, None])
144+
def test_2195(datetime_is_numeric):
145+
data = {
146+
"categorical": pd.Categorical(["d"] * 10 ** 2),
147+
"date": [np.datetime64("2000-01-01")] * 10 ** 2,
148+
}
149+
150+
modin_df, pandas_df = pd.DataFrame(data), pandas.DataFrame(data)
151+
152+
eval_general(
153+
modin_df,
154+
pandas_df,
155+
lambda df: df.describe(datetime_is_numeric=datetime_is_numeric),
156+
)
157+
158+
143159
@pytest.mark.parametrize(
144160
"exclude,include",
145161
[

0 commit comments

Comments
 (0)