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 Jan 29, 2024
1 parent f8eaf90 commit f75c108
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 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
7 changes: 4 additions & 3 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 Down Expand Up @@ -1965,7 +1966,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 f75c108

Please sign in to comment.