You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "thisisnic (via GitHub)" <gi...@apache.org> on 2026/09/13 16:05:02 UTC

[PR] GH-37761: [R] Argument names ignored in schema supplied as in_type argument to register_scalar_function() [arrow]

thisisnic opened a new pull request, #51324:
URL: https://github.com/apache/arrow/pull/51324

   ### Rationale for this change
   
   No validation/warning makes it easy for incorrectly specified UDFs to appear to work...but they don't!
   
   ### What changes are included in this PR?
   
   Validation
   
   ### Are these changes tested?
   
   Yeah
   
   ### Are there any user-facing changes?
   
   I guess if they have incorrectly specified UDFs, yeah
   
   ## AI usage
   
   All of it, we talked. I should re


-- 
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


Re: [PR] GH-37761: [R] Argument names ignored in schema supplied as in_type argument to register_scalar_function() [arrow]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-37761: [R] Argument names ignored in schema supplied as in_type argument to register_scalar_function() [arrow]

Posted by "thisisnic (via GitHub)" <gi...@apache.org>.
thisisnic merged PR #51324:
URL: https://github.com/apache/arrow/pull/51324


-- 
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


Re: [PR] GH-37761: [R] Argument names ignored in schema supplied as in_type argument to register_scalar_function() [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #51324:
URL: https://github.com/apache/arrow/pull/51324#issuecomment-5654404538

   :warning: GitHub issue #37761 **has been automatically assigned in GitHub** to PR creator.


-- 
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