You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/11/17 09:48:45 UTC
[GitHub] [arrow] pitrou commented on a change in pull request #11721: ARROW-14732: [Python] Improve error message in compute functions when passing wrong number of positional arguments
pitrou commented on a change in pull request #11721:
URL: https://github.com/apache/arrow/pull/11721#discussion_r751070296
##########
File path: python/pyarrow/compute.py
##########
@@ -180,12 +180,22 @@ def _handle_options(name, option_class, options, kwargs):
return options
-def _make_generic_wrapper(func_name, func, option_class):
+def _make_generic_wrapper(func_name, func, option_class, arity):
if option_class is None:
def wrapper(*args, memory_pool=None):
+ if arity is not None and len(args) != arity:
+ raise TypeError(
+ "{} takes {} positional argument(s), but {} were "
+ "given".format(func_name, arity, len(args))
Review comment:
Nit: we can use format strings nowadays :-)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org