singhpratech commented on PR #51236:
URL: https://github.com/apache/arrow/pull/51236#issuecomment-5925061337
Thank you both for taking the time, and Dewey, thanks for the
`nanoarrow/r.h` pointer — inlining the
allocators that way is a clean answer for a package that cannot take a
dependency, and I will use it.
I am glad to go whichever way the project prefers. I would just like to put
a few facts next to the
decision, since they shaped this PR and may be useful whoever reads #39793
next:
- The project's own Python ↔ R integration guide
(`docs/source/python/integration/python_r.rst`)
shows R code calling `Array$import_from_c(array_ptr, schema_ptr)` and
`Array$export_to_c(...)`.
Today the R package has no help page for either method, and `?Array` does
not list them.
- The six allocators are already in the package: `r/R/python.R` uses them
for the reticulate bridge.
Exporting them is +170 / −0 across eight files and changes no behaviour.
- #39793 has been open since January 2024 and was un-staled in November
2025, when a maintainer asked
on the issue whether the reporter would open a PR; this PR is that
follow-through.
- nanoarrow's own R package calls `Array$import_from_c()` and
`$export_to_c()`, so those two methods
are public API in practice already.
Where I agree completely: for working with the C structures, nanoarrow is
the right tool and the
right recommendation. The case this PR was aimed at is narrower — a package
that already depends on
arrow and only needs to pass one array across the interface — and for that
case the choice today is
`arrow:::` (which `R CMD check` flags) or a second dependency to allocate
two small structs.
Two ways to close this out, and I am happy with either:
1. **Documentation only.** I trim the PR to documenting `$export_to_c()` and
`$import_from_c()` on
`?Array`, with the example allocating through nanoarrow and a line
pointing readers to nanoarrow
for everything beyond passing a pointer; the exports, the test and the
NEWS entry go. If that is
the decision, closing #39793 with that reason would spare the next person
the same loop.
2. **As filed.** Export the six functions as the issue asks.
Tell me which, and I will have the branch updated the same day. Thanks again
for the reviews.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]