Copilot commented on code in PR #51324:
URL: https://github.com/apache/arrow/pull/51324#discussion_r4000102071
##########
r/R/udf.R:
##########
@@ -157,6 +159,28 @@ arrow_scalar_function <- function(fun, in_type, out_type,
auto_convert = FALSE)
)
}
+ # Arguments are passed to fun by position, so if the user named the
+ # fields in in_type, make sure those names line up with fun's arguments
+ # rather than silently ignoring them (GH-37761)
+ if (!fun_formals_have_dots) {
Review Comment:
`fun_formals_have_dots` is also true for functions with explicit arguments,
such as `function(context, x, ...)`, so this bypasses the new validation and
still accepts `schema(blah = int32())` even though the first positional input
is `x`. Please validate the explicitly declared formals before `...`; only an
entirely variadic function should accept arbitrary field names while preserving
the positional binding contract.
--
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]