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

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


The following commit(s) were added to refs/heads/main by this push:
     new 92a5c8b3dc GH-47941: [R] Fix codegen.R error from dplyr pipe to base 
pipe change (#47985)
92a5c8b3dc is described below

commit 92a5c8b3dc7152e074e71b5e5be4ce9517e92954
Author: Nic Crane <[email protected]>
AuthorDate: Tue Nov 11 15:09:50 2025 +0000

    GH-47941: [R] Fix codegen.R error from dplyr pipe to base pipe change 
(#47985)
    
    ### Rationale for this change
    
    Switching to base pipe means that we need to update some syntax in 
codegen.R otherwise it errors when run
    
    ### What changes are included in this PR?
    
    Factor out code into own function so can use base pipe
    
    ### Are these changes tested?
    
    No, though weird it didn't fail on CI - looking into this!
    
    ### Are there any user-facing changes?
    
    Nope
    * GitHub Issue: #47941
    
    Authored-by: Nic Crane <[email protected]>
    Signed-off-by: Nic Crane <[email protected]>
---
 r/configure.win      | 2 +-
 r/data-raw/codegen.R | 8 +++++---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/r/configure.win b/r/configure.win
index ade82b143e..433ef28439 100755
--- a/r/configure.win
+++ b/r/configure.win
@@ -31,7 +31,7 @@ ARROW_R_DEV=`echo $ARROW_R_DEV | tr '[:upper:]' '[:lower:]'`
 ARROW_USE_PKG_CONFIG=`echo $ARROW_USE_PKG_CONFIG | tr '[:upper:]' '[:lower:]'`
 
 # generate code
-if [ "$ARROW_R_DEV" == "true" ]; then
+if [ "$ARROW_R_DEV" = "true" ] && [ -f "data-raw/codegen.R" ]; then
   echo "*** Generating code with data-raw/codegen.R"
   "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" data-raw/codegen.R
 fi
diff --git a/r/data-raw/codegen.R b/r/data-raw/codegen.R
index a5a6da197d..b7bee39b77 100644
--- a/r/data-raw/codegen.R
+++ b/r/data-raw/codegen.R
@@ -40,13 +40,15 @@ suppressPackageStartupMessages({
   library(vctrs)
 })
 
+cbind_unnested_functions <- function(data) {
+  vec_cbind(data, vec_rbind(!!!pull(data, functions)))
+}
+
 get_exported_functions <- function(decorations, export_tag) {
   out <- decorations |>
     filter(decoration %in% paste0(export_tag, "::export")) |>
     mutate(functions = map(context, decor:::parse_cpp_function)) |>
-    {
-      vec_cbind(., vec_rbind(!!!pull(., functions)))
-    } |>
+    cbind_unnested_functions() |>
     select(-functions) |>
     mutate(decoration = sub("::export", "", decoration))
   message(glue(

Reply via email to