Skip to content

Commit 079ce82

Browse files
authored
Update doc files to match recent fixes for latest pyarrow/polars. (#22)
1 parent 96d8912 commit 079ce82

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

doc/notebooks/faster-rpy2-conversion.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ custom converter for :mod:`rpy2` is done in few lines of code.
8585
...: # We build a custom converter that is the default converter
8686
...: # for ipython/jupyter shipping with rpy2, to which we add
8787
...: # rules for Arrow + pandas we just made.
88-
...: conv = rpy2.ipython.rmagic.converter + conv
88+
...: conv = rpy2.ipython.rmagic.default.converter + conv
8989

9090
Our custom converter ``conv`` can be specified as a parameter to
9191
``%%R``:
@@ -118,7 +118,7 @@ It is also possible to only convert to an Arrow data structure.
118118
...: pa_tbl = pyarrow.Table.from_pandas(dataf)
119119
...: return pyra.converter.py2rpy(pa_tbl)
120120
...:
121-
...: conv2 = rpy2.ipython.rmagic.converter + conv2
121+
...: conv2 = rpy2.ipython.rmagic.default.converter + conv2
122122

123123
.. ipython::
124124

rpy2_arrow/arrow.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,9 @@ def pyarrow_to_r_recordbatchreader(
125125

126126
stream_ptr = ffi.new('struct ArrowArrayStream*')
127127
obj._export_to_c(_c_ptr_to_int(stream_ptr))
128-
return rarrow.RecordBatchReader['import_from_c'](_rarrow_ptr(stream_ptr))
128+
with robjects.default_converter.context():
129+
r_ptr = _rarrow_ptr(stream_ptr)
130+
return rarrow.RecordBatchReader['import_from_c'](r_ptr)
129131

130132

131133
def rarrow_to_py_recordbatchreader(

0 commit comments

Comments
 (0)