You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by am...@apache.org on 2022/02/23 10:38:24 UTC

[arrow] branch master updated: ARROW-15369: [Doc] Tweak example to use the new support for str pointers

This is an automated email from the ASF dual-hosted git repository.

amolina pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new 53e1296  ARROW-15369: [Doc] Tweak example to use the new support for str pointers
53e1296 is described below

commit 53e12965981a419021ce1c19784e4e6766e5b137
Author: Alessandro Molina <am...@turbogears.org>
AuthorDate: Wed Feb 23 11:34:53 2022 +0100

    ARROW-15369: [Doc] Tweak example to use the new support for str pointers
    
    Closes #12495 from amol-/ARROW-15369
    
    Authored-by: Alessandro Molina <am...@turbogears.org>
    Signed-off-by: Alessandro Molina <am...@turbogears.org>
---
 docs/source/python/integration/python_r.rst | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/docs/source/python/integration/python_r.rst b/docs/source/python/integration/python_r.rst
index 18d9e4c..20627c3 100644
--- a/docs/source/python/integration/python_r.rst
+++ b/docs/source/python/integration/python_r.rst
@@ -227,9 +227,6 @@ Our ``addthree.R`` will thus have both the ``addthree_cdata`` and the
     library(arrow)
 
     addthree_cdata <- function(array_ptr_s, schema_ptr_s) {
-        array_ptr <- as.numeric(array_ptr_s)
-        schema_ptr <- as.numeric(schema_ptr_s)
-
         a <- Array$import_from_c(array_ptr, schema_ptr)
 
         return(addthree(a))
@@ -256,7 +253,6 @@ Our ``addthree.py`` will thus become:
     r_source = robjects.r["source"]
     r_source("addthree.R")
     addthree_cdata = robjects.r["addthree_cdata"]
-    as_r_numeric = robjects.r["as.numeric"]
 
     # Create the pyarrow array we want to pass to R
     import pyarrow
@@ -288,8 +284,7 @@ Our ``addthree.py`` will thus become:
         # arrow Array built from R as the return value of addthree.
         # To make it available as a Python pyarrow array we need to export
         # it as a C Data structure invoking the Array$export_to_c R method
-        r_result_array["export_to_c"](as_r_numeric(str(c_array_ptr)),
-                                      as_r_numeric(str(c_schema_ptr)))
+        r_result_array["export_to_c"](str(c_array_ptr), str(c_schema_ptr))
 
         # Once the returned array is exported to a C Data infrastructure
         # we can import it back into pyarrow using Array._import_from_c