File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff 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
9090Our 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
Original file line number Diff line number Diff 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
131133def rarrow_to_py_recordbatchreader (
You can’t perform that action at this time.
0 commit comments