Skip to content

Commit 4077efe

Browse files
authored
GH-47936: [R] docgen.R requires installed package instead of current working code (#47940)
### Rationale for this change R package doc generation uses installed version of package so creates wrong docs if older version installed. ### What changes are included in this PR? Use devtools::load_all() to load the package first when running locally. ### Are these changes tested? CI should be happy, but I did test locally. ### Are there any user-facing changes? Nah. * GitHub Issue: #47936 Authored-by: Nic Crane <thisisnic@gmail.com> Signed-off-by: Nic Crane <thisisnic@gmail.com>
1 parent 7185902 commit 4077efe

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

r/data-raw/docgen.R

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,17 @@ render_pkg <- function(df, pkg) {
128128
paste("#'", c(header, bullets), collapse = "\n")
129129
}
130130

131+
# Load the current development version so we get the latest function mappings
132+
if (requireNamespace("devtools", quietly = TRUE)) {
133+
devtools::load_all()
134+
} else {
135+
warning(
136+
"devtools is not installed. Using installed arrow package instead of current working code.\n",
137+
"To generate accurate docs, install the current branch version of arrow first via `R CMD INSTALL .` ",
138+
"or install devtools before running this script again."
139+
)
140+
}
141+
131142
docs <- arrow:::.cache$docs
132143

133144
# Add some functions

0 commit comments

Comments
 (0)