Skip to content

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
apache:mainfrom
thisisnic:GH-37762-schema-validation
Open

GH-37761: [R] Argument names ignored in schema supplied as in_type argument to register_scalar_function()#51324
thisisnic wants to merge 2 commits into
apache:mainfrom
thisisnic:GH-37762-schema-validation

Conversation

@thisisnic

@thisisnic thisisnic commented Sep 13, 2026

Copy link
Copy Markdown
Member

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

@thisisnic
thisisnic requested a review from jonkeane as a code owner September 13, 2026 16:05
Copilot AI lite review requested due to automatic review settings September 13, 2026 16:05
@github-actions github-actions Bot added the awaiting committer review Awaiting committer review label Sep 13, 2026
@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #37761 has been automatically assigned in GitHub to PR creator.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread r/R/udf.R
# 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) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting committer review Awaiting committer review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants