GH-39793: [R] Export the C Data Interface allocators and document $export_to_c() / $import_from_c() - #51236
Open
singhpratech wants to merge 2 commits into
Open
Conversation
…nt $export_to_c() / $import_from_c() allocate_arrow_schema(), delete_arrow_schema(), allocate_arrow_array(), delete_arrow_array(), allocate_arrow_array_stream() and delete_arrow_array_stream() are now exported, with a help page (?c-data-interface) that shows the round trip, and the Array methods list names $export_to_c() and $import_from_c(). Two tests cover the exports and an Array round trip through the exported functions. Closes apache#39793.
singhpratech
added a commit
to singhpratech/ArrowMetal
that referenced
this pull request
Sep 8, 2026
…Data Interface exports Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WQYE6hSNYZur5fRZC3mqGT
|
|
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
Follows up on #39793.
Array$export_to_c()andArray$import_from_c()work, but the functions thatproduce the pointers they take,
allocate_arrow_schema()and friends, are not exported, and none ofit has a help page, so a package that hands a column to another library over the C Data Interface
has to use
arrow:::, whichR CMD checkflags.What changes are included in this PR?
The six allocate/delete functions from the issue are exported and documented on one help page
(
?c-data-interface) with a round-trip example; theArraymethods list names$export_to_c()and
$import_from_c(); a NEWS entry; two tests in test-bridge.R. NAMESPACE and the man pages wereregenerated with roxygen2 8.0.0, the version in
Config/roxygen2/version, so the diff is only theadditions. Per @thisisnic's note on #51227, the alignment behaviour of
Array$create()is a codecomment in the new file, not user documentation.
Are these changes tested?
Yes:
test-bridge.Rgains a test that the six names are exported and a test that anArraywitha null round-trips through the exported functions. The example on the help page runs under
R CMD checkas well.Are there any user-facing changes?
Yes: six newly exported functions and one new help page. No existing behaviour changes.
Thank you for looking at this. Happy to adjust the wording of the help page or move the
functions' documentation wherever fits the package's conventions better.
Closes #39793.