HyukjinKwon commented on code in PR #39128:
URL: https://github.com/apache/spark/pull/39128#discussion_r1052752065
##########
python/pyspark/sql/functions.py:
##########
@@ -8122,15 +8130,13 @@ def _get_lambda_parameters(f: Callable) ->
ValuesView[inspect.Parameter]:
# Validate that
# function arity is between 1 and 3
if not (1 <= len(parameters) <= 3):
- raise ValueError(
- "f should take between 1 and 3 arguments, but provided function
takes {}".format(
- len(parameters)
- )
+ raise invalidHigherOrderFunctionArgumentNumberError(
+ func_name=f.__name__, num_args=len(parameters)
)
# and all arguments can be used as positional
if not all(p.kind in supported_parameter_types for p in parameters):
- raise ValueError("f should use only POSITIONAL or POSITIONAL OR
KEYWORD arguments")
+ raise
invalidParameterTypeForHigherOrderFunctionError(func_name=f.__name__)
Review Comment:
If you plan to do this all in other places, please file an umbrella JIRA
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]