Skip to content

GH-49649: [R] R non-API calls reported on CRAN#49653

Open
thisisnic wants to merge 4 commits intoapache:mainfrom
thisisnic:GH-49649-more-non-api
Open

GH-49649: [R] R non-API calls reported on CRAN#49653
thisisnic wants to merge 4 commits intoapache:mainfrom
thisisnic:GH-49649-more-non-api

Conversation

@thisisnic
Copy link
Copy Markdown
Member

@thisisnic thisisnic commented Apr 2, 2026

Rationale for this change

CRAN reports non-API calls

What changes are included in this PR?

Swap 'em out

Are these changes tested?

I'll test with CI

Are there any user-facing changes?

Nah

AI usage

Used Claude, asked it lots of questions about what it was doing and why, answers sounded reasonable.

@thisisnic thisisnic requested a review from jonkeane as a code owner April 2, 2026 21:57
@github-actions github-actions bot added Component: R awaiting committer review Awaiting committer review labels Apr 2, 2026
@thisisnic
Copy link
Copy Markdown
Member Author

Once this is reviewed, we should rebase it on #49655 before this so we can check it properly.

@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting committer review Awaiting committer review labels Apr 3, 2026
Comment on lines -211 to +224
#if R_VERSION >= R_Version(4, 5, 0)
SEXP xp = R_getVarEx(arrow::r::symbols::xp, self, FALSE, R_UnboundValue);
#if R_VERSION >= R_Version(4, 6, 0)
if (!R_existsVarInFrame(self, arrow::r::symbols::xp)) {
cpp11::stop("Invalid: self$`.:xp:.` is NULL");
}
SEXP xp = R_getVar(arrow::r::symbols::xp, self, FALSE);
if (xp == R_NilValue) {
cpp11::stop("Invalid: self$`.:xp:.` is NULL");
}
#else
SEXP xp = Rf_findVarInFrame(self, arrow::r::symbols::xp);
#endif
if (xp == R_UnboundValue || xp == R_NilValue) {
cpp11::stop("Invalid: self$`.:xp:.` is NULL");
}
#endif
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We might need three branches here: <4.5, >=4.5<4.6, >=4.6 so that we avoid Rf_findVarInFrame on oldrel right?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yup!

@thisisnic
Copy link
Copy Markdown
Member Author

Sorry Jon, this is me doing a crap job of reviewing AI code; I'm redoing this and being more thorough about my checking. Non-Claude models seem to have gotten better at convincing me they're correct without actually being more correct.

@thisisnic thisisnic force-pushed the GH-49649-more-non-api branch from c4eff7e to 734790f Compare April 4, 2026 17:36
@github-actions github-actions bot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Apr 4, 2026
@thisisnic
Copy link
Copy Markdown
Member Author

The changes on this PR won't affect R_NamespaceRegistry but we don't use it - it's from cpp11 who did a release super recently so they no longer use it.

@thisisnic thisisnic marked this pull request as draft April 4, 2026 17:48
@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting change review Awaiting change review labels Apr 4, 2026
@thisisnic thisisnic marked this pull request as ready for review April 4, 2026 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants