Skip to content

Commit

Permalink
FIX-#7062: Update exception message for aggregate function (#7063)
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 Mar 12, 2024
1 parent 441be09 commit 73ba1fc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modin/pandas/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ def error_raiser(msg, exception=Exception):
if isinstance(fn, str):
if not (hasattr(self, fn) or hasattr(np, fn)):
on_invalid(
f"{fn} is not valid function for {type(self)} object.",
f"'{fn}' is not a valid function for '{type(self).__name__}' object",
AttributeError,
)
elif not callable(fn):
Expand Down
7 changes: 6 additions & 1 deletion modin/pandas/test/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,12 @@ def test_aggregate_error_checking(data):
lambda series: series.aggregate("cumprod"),
)
eval_general(
modin_series, pandas_series, lambda series: series.aggregate("NOT_EXISTS")
modin_series,
pandas_series,
lambda series: series.aggregate("NOT_EXISTS"),
raising_exceptions=AttributeError(
"'NOT_EXISTS' is not a valid function for 'Series' object"
),
)


Expand Down

0 comments on commit 73ba1fc

Please sign in to comment.