jorisvandenbossche commented on a change in pull request #11721:
URL: https://github.com/apache/arrow/pull/11721#discussion_r751073619



##########
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:
       Ah, I actually wrote them first that way and then converted to this 
thinking we can't use it yet .. Will convert back :)




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to