Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Anatoly Myachev <[email protected]>
  • Loading branch information
anmyachev committed Sep 23, 2023
1 parent b36c35f commit 21b39d0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 23 deletions.
10 changes: 1 addition & 9 deletions modin/core/dataframe/algebra/default2pandas/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

"""Module houses default GroupBy functions builder class."""

import functools
import warnings
from typing import Any

Expand Down Expand Up @@ -598,15 +597,8 @@ def register(cls, func, **kwargs):
Functiom that takes query compiler and defaults to pandas to do GroupBy
aggregation.
"""

@functools.wraps(func)
def func_catch_warnings(*args, **kwargs):
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=FutureWarning)
return func(*args, **kwargs)

return super().register(
cls._groupby_cls.build_groupby(func_catch_warnings),
cls._groupby_cls.build_groupby(func),
fn_name=func.__name__,
**kwargs,
)
Expand Down
26 changes: 12 additions & 14 deletions modin/pandas/test/test_groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,13 +297,12 @@ def test_mixed_dtypes_groupby(as_index):
eval_cumprod(modin_groupby, pandas_groupby, numeric_only=True)
# numeric_only=False doesn't work

# FIXME: ValueError: cannot join with no overlapping index names
# eval_general(
# modin_groupby,
# pandas_groupby,
# lambda df: df.cov(numeric_only=True),
# modin_df_almost_equals_pandas,
# )
eval_general(
modin_groupby,
pandas_groupby,
lambda df: df.cov(numeric_only=True),
modin_df_almost_equals_pandas,
)

transform_functions = [lambda df: df, lambda df: df + df]
for func in transform_functions:
Expand All @@ -313,13 +312,12 @@ def test_mixed_dtypes_groupby(as_index):
for func in pipe_functions:
eval_pipe(modin_groupby, pandas_groupby, func)

# FIXME: ValueError: cannot join with no overlapping index names
# eval_general(
# modin_groupby,
# pandas_groupby,
# lambda df: df.corr(numeric_only=True),
# modin_df_almost_equals_pandas,
# )
eval_general(
modin_groupby,
pandas_groupby,
lambda df: df.corr(numeric_only=True),
modin_df_almost_equals_pandas,
)

eval_fillna(modin_groupby, pandas_groupby)
eval_count(modin_groupby, pandas_groupby)
Expand Down

0 comments on commit 21b39d0

Please sign in to comment.