Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions r/configure
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ UNAME=`uname -s`
if [ "$ARROW_R_DEV" = "true" ] && [ -f "data-raw/codegen.R" ]; then
echo "*** Generating code with data-raw/codegen.R"
${R_HOME}/bin/Rscript data-raw/codegen.R
CODEGEN_STATUS=$?
if [ $CODEGEN_STATUS -ne 0 ]; then
echo "*** ERROR: codegen.R failed"
exit 1
fi
fi

# Arrow requires C++17, so check for it
Expand Down
5 changes: 5 additions & 0 deletions r/configure.win
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ ARROW_USE_PKG_CONFIG=`echo $ARROW_USE_PKG_CONFIG | tr '[:upper:]' '[:lower:]'`
if [ "$ARROW_R_DEV" == "true" ]; then
echo "*** Generating code with data-raw/codegen.R"
"${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" data-raw/codegen.R
CODEGEN_STATUS=$?
if [ $CODEGEN_STATUS -ne 0 ]; then
echo "*** ERROR: codegen.R failed"
exit 1
fi
fi

# Test if pkg-config is available to use
Expand Down
8 changes: 5 additions & 3 deletions r/data-raw/codegen.R
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Loading