Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Anatoly Myachev <anatoly.myachev@intel.com>
  • Loading branch information
anmyachev committed Jan 29, 2024
1 parent f8eaf90 commit 76edff1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
5 changes: 0 additions & 5 deletions modin/pandas/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,11 +656,6 @@ def aggregate(self, func=None, axis=0, *args, **kwargs): # noqa: PR01, RT01, D2
"""
axis = self._get_axis_number(axis)

# if func is None, will switch to user-provided "named aggregation" kwargs
# if func is None:
# func = dict(kwargs.items())
# kwargs = {}

result = None

if axis == 0:
Expand Down
12 changes: 4 additions & 8 deletions modin/pandas/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -1924,9 +1924,10 @@ def nsmallest(self, n=5, keep="first"):
)
)

def validate_func_kwargs(self, kwargs: dict):
def _validate_func_kwargs(self, kwargs: dict):
"""
Validates types of user-provided "named aggregation" kwargs.
Validate types of user-provided "named aggregation" kwargs.
`TypeError` is raised if aggfunc is not `str` or callable.
Parameters
Expand All @@ -1940,11 +1941,6 @@ def validate_func_kwargs(self, kwargs: dict):
func : List[Union[str, callable[...,Any]]]
List of user-provided aggfuncs
Examples
--------
>>> validate_func_kwargs({'one': 'min', 'two': 'max'})
(['one', 'two'], ['min', 'max'])
Notes
-----
Copied from pandas
Expand All @@ -1965,7 +1961,7 @@ def aggregate(self, func=None, *args, engine=None, engine_kwargs=None, **kwargs)
engine_default = engine is None and engine_kwargs is None
# if func is None, will switch to user-provided "named aggregation" kwargs
if func_is_none := func is None:
columns, func = self.validate_func_kwargs(kwargs)
columns, func = self._validate_func_kwargs(kwargs)
kwargs = {}
if isinstance(func, dict) and engine_default:
raise SpecificationError("nested renamer is not supported")
Expand Down

0 comments on commit 76edff1

Please sign in to comment.