Skip to content

Commit

Permalink
FIX-modin-project#2254: Lint fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Gregory Shimansky <gregory.shimansky@intel.com>
  • Loading branch information
gshimansky committed Nov 5, 2020
1 parent 2a7315e commit 9709266
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion modin/backends/pandas/query_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2579,7 +2579,11 @@ def groupby_agg(
# because default to pandas is unable to operate with dictionary aggregation function argument,
# it accepts only callable functions.
if isinstance(agg_func, dict):
callable_func = lambda df, *args, **kwargs: df.aggregate(agg_func, *agg_args, **agg_kwargs)
callable_func = wrap_udf_function(
lambda df, *args, **kwargs: df.aggregate(
agg_func, *agg_args, **agg_kwargs
)
)
else:
callable_func = agg_func
return super().groupby_agg(
Expand Down
4 changes: 3 additions & 1 deletion modin/pandas/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,9 @@ def _apply_agg_function(self, f, drop=True, *args, **kwargs):
-------
A new combined DataFrame with the result of all groups.
"""
assert callable(f) or isinstance(f, dict), "'{0}' object is not callable and not a dict".format(type(f))
assert callable(f) or isinstance(
f, dict
), "'{0}' object is not callable and not a dict".format(type(f))

# For aggregations, pandas behavior does this for the result.
# For other operations it does not, so we wait until there is an aggregation to
Expand Down

0 comments on commit 9709266

Please sign in to comment.