This is an automated email from the ASF dual-hosted git repository.
brycemecum pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-cookbook.git
The following commit(s) were added to refs/heads/main by this push:
new a7ba7b5 [R]: Fix reticulate error in R cookbook test (#382)
a7ba7b5 is described below
commit a7ba7b57cd149ced6b601c24ff81f2c0241f9994
Author: Bryce Mecum <[email protected]>
AuthorDate: Sun Jul 27 21:18:26 2025 -0700
[R]: Fix reticulate error in R cookbook test (#382)
Fixes https://github.com/apache/arrow-cookbook/issues/381. See for more
context.
I didn't think you had to do this but the docs suggest maybe you do.
Without this, we were getting,
── Failed tests
────────────────────────────────────────────────────────────────
Error ('test-python.R:39:1'): (code run outside of `test_that()`)
<python.builtin.ModuleNotFoundError/python.builtin.ImportError/python.builtin.Exception/python.builtin.BaseException/python.builtin.object/error/condition>
Error in `py_module_import(module, convert = convert)`:
ModuleNotFoundError: No module named 'pyarrow'
Run `reticulate::py_last_error()` for details.
Backtrace:
▆
1. └─reticulate::import("pyarrow") at test-python.R:39:1
2. └─reticulate:::py_module_import(module, convert = convert)
[ FAIL 1 | WARN 2 | SKIP 0 | PASS 85 ]
---
r/content/python.Rmd | 2 ++
1 file changed, 2 insertions(+)
diff --git a/r/content/python.Rmd b/r/content/python.Rmd
index 76c5ec4..23280ca 100644
--- a/r/content/python.Rmd
+++ b/r/content/python.Rmd
@@ -32,6 +32,8 @@ You want to use PyArrow to create an Arrow object in an R
session.
```{r, pyarrow_object}
library(reticulate)
+py_require("pyarrow")
+
pa <- import("pyarrow")
pyarrow_scalar <- pa$scalar(42)
pyarrow_scalar