GH-37761: [R] Argument names ignored in schema supplied as in_type argument to register_scalar_function() - #51324
Open
thisisnic wants to merge 2 commits into
Open
GH-37761: [R] Argument names ignored in schema supplied as in_type argument to register_scalar_function()#51324thisisnic wants to merge 2 commits into
thisisnic wants to merge 2 commits into
Conversation
|
|
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Validation still bypasses explicitly declared arguments when a function also includes ....
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds validation to ensure named UDF input schemas match function argument names.
Changes:
- Implements argument-name validation.
- Adds regression tests and snapshots.
- Updates documentation.
File summaries
| File | Description |
|---|---|
r/tests/testthat/test-udf.R |
Adds validation tests. |
r/tests/testthat/_snaps/udf.md |
Records validation output. |
r/R/udf.R |
Implements argument-name validation. |
r/man/register_scalar_function.Rd |
Documents naming requirements. |
Review details
Files not reviewed (1)
- r/man/register_scalar_function.Rd: Generated file
- Files reviewed: 3/4 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| # 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) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 tho
in_typeargument toregister_scalar_function()#37761