Skip to content

Commit 92a5c8b

Browse files
authored
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]>
1 parent 08f8b54 commit 92a5c8b

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

r/configure.win

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ ARROW_R_DEV=`echo $ARROW_R_DEV | tr '[:upper:]' '[:lower:]'`
3131
ARROW_USE_PKG_CONFIG=`echo $ARROW_USE_PKG_CONFIG | tr '[:upper:]' '[:lower:]'`
3232

3333
# generate code
34-
if [ "$ARROW_R_DEV" == "true" ]; then
34+
if [ "$ARROW_R_DEV" = "true" ] && [ -f "data-raw/codegen.R" ]; then
3535
echo "*** Generating code with data-raw/codegen.R"
3636
"${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" data-raw/codegen.R
3737
fi

r/data-raw/codegen.R

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,15 @@ suppressPackageStartupMessages({
4040
library(vctrs)
4141
})
4242

43+
cbind_unnested_functions <- function(data) {
44+
vec_cbind(data, vec_rbind(!!!pull(data, functions)))
45+
}
46+
4347
get_exported_functions <- function(decorations, export_tag) {
4448
out <- decorations |>
4549
filter(decoration %in% paste0(export_tag, "::export")) |>
4650
mutate(functions = map(context, decor:::parse_cpp_function)) |>
47-
{
48-
vec_cbind(., vec_rbind(!!!pull(., functions)))
49-
} |>
51+
cbind_unnested_functions() |>
5052
select(-functions) |>
5153
mutate(decoration = sub("::export", "", decoration))
5254
message(glue(

0 commit comments

Comments
 (0)