GH-49649: [R] R non-API calls reported on CRAN#49653
Open
thisisnic wants to merge 1 commit intoapache:mainfrom
Open
GH-49649: [R] R non-API calls reported on CRAN#49653thisisnic wants to merge 1 commit intoapache:mainfrom
thisisnic wants to merge 1 commit intoapache:mainfrom
Conversation
Member
Author
|
Once this is reviewed, we should rebase it on #49655 before this so we can check it properly. |
jonkeane
reviewed
Apr 3, 2026
Comment on lines
-391
to
+403
| // R_existsVarInFrame doesn't exist before R 4.2, so we need to fall back to | ||
| // Rf_findVarInFrame3 if it is not defined. | ||
| #if R_VERSION >= R_Version(4, 2, 0) | ||
| #if R_VERSION >= R_Version(4, 6, 0) |
Member
There was a problem hiding this comment.
I don't understand this change? Why do we need to bump this version higher?
jonkeane
reviewed
Apr 3, 2026
| cpp11::stop("No arrow R6 class named '%s'", r6_class_name); | ||
| } | ||
| #else | ||
| // Rf_findVarInFrame3 and R_UnboundValue are non-API as of R 4.6 |
Member
There was a problem hiding this comment.
But this else was only <4.2.0 anyway no?
jonkeane
reviewed
Apr 3, 2026
| // returns the namespace environment for package `name` | ||
| SEXP precious_namespace(std::string name) { | ||
| SEXP s_name = PROTECT(cpp11::writable::strings({name})); | ||
| SEXP ns = R_FindNamespace(s_name); |
Member
There was a problem hiding this comment.
I don't see any NOTEs about this one? Do we need to remove it?
jonkeane
reviewed
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 |
Member
There was a problem hiding this comment.
We might need three branches here: <4.5, >=4.5<4.6, >=4.6 so that we avoid Rf_findVarInFrame on oldrel right?
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
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.