Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Iaroslav Igoshev <Poolliver868@mail.ru>
  • Loading branch information
anmyachev and YarShev committed Jan 30, 2024
1 parent 6758d1e commit 87d0ee9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions modin/pandas/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -1947,16 +1947,14 @@ def _validate_func_kwargs(self, kwargs: dict):
-----
Copied from pandas.
"""
tuple_given_message = "func is expected but received {} in **kwargs."
columns = list(kwargs)
funcs = []
for col_func in kwargs.values():
if not (isinstance(col_func, str) or callable(col_func)):
raise TypeError(tuple_given_message.format(type(col_func).__name__))
raise TypeError(f"func is expected but received {type(col_func).__name__} in **kwargs.")
funcs.append(col_func)
if not columns:
no_arg_message = "Must provide 'func' or named aggregation **kwargs."
raise TypeError(no_arg_message)
raise TypeError("Must provide 'func' or named aggregation **kwargs.")
return columns, funcs

Check warning on line 1958 in modin/pandas/groupby.py

View check run for this annotation

Codecov / codecov/patch

modin/pandas/groupby.py#L1950-L1958

Added lines #L1950 - L1958 were not covered by tests

def aggregate(self, func=None, *args, engine=None, engine_kwargs=None, **kwargs):
Expand Down

0 comments on commit 87d0ee9

Please sign in to comment.