paleolimbot opened a new pull request, #39977:
URL: https://github.com/apache/arrow/pull/39977
### Rationale for this change
While #39969 fixed the immediate issue caused by the update of the capsule
name used by reticulate whilst converting an R "external pointer", it will
still result in an error if somebody is using an older version of the Arrow R
package.
### What changes are included in this PR?
The pyarrow Cython code was modified to accept capsules with the name NULL
or "r_extptr".
### Are these changes tested?
Not sure where the best place for this is, but:
CRAN arrow + released pyarrow + new reticulate (errors):
``` r
library(arrow, warn.conflicts = FALSE)
reticulate::use_virtualenv("~/Desktop/rscratch/arrow/.venv")
packageVersion("arrow")
#> [1] '14.0.0.2'
packageVersion("reticulate")
#> [1] '1.35.0'
pa <- reticulate::import("pyarrow")
pa[["__version__"]]
#> [1] "15.0.0"
reticulate::r_to_py(arrow::int32())
#> PyCapsule_GetPointer called with incorrect name
```
CRAN arrow + pyarrow from this PR + old reticulate:
``` r
library(arrow, warn.conflicts = FALSE)
reticulate::use_virtualenv("../.venv")
#> Error in reticulate::use_virtualenv("../.venv"): Directory ../.venv is
not a Python virtualenv
packageVersion("arrow")
#> [1] '14.0.0.2'
packageVersion("reticulate")
#> [1] '1.34.0'
pa <- reticulate::import("pyarrow")
pa[["__version__"]]
#> [1] "16.0.0.dev86+gc9f6e0432.d20240207"
reticulate::r_to_py(arrow::int32())
#> DataType(int32)
```
CRAN arrow + pyarrow from this PR + new reticulate:
``` r
library(arrow, warn.conflicts = FALSE)
reticulate::use_virtualenv("~/Desktop/rscratch/arrow/.venv")
packageVersion("arrow")
#> [1] '14.0.0.2'
packageVersion("reticulate")
#> [1] '1.35.0'
pa <- reticulate::import("pyarrow")
pa[["__version__"]]
#> [1] "16.0.0.dev92+geafcff7a5"
reticulate::r_to_py(arrow::int32())
#> DataType(int32)
```
### Are there any user-facing changes?
No
--
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]