Skip to content

Commit

Permalink
Update DBI/RSQLite chunk eval logic (#63)
Browse files Browse the repository at this point in the history
Avoid check errors on GHA and CRAN by suppressing vignette chunks that trigger vroom "bad value" error
  • Loading branch information
robe2037 committed Oct 19, 2023
1 parent c7a7ec0 commit 5a4c055
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
1 change: 0 additions & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ jobs:
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
remotes::install_github("r-dbi/RSQLite")
shell: Rscript {0}

- name: Session info
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ jobs:
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
remotes::install_github("r-dbi/RSQLite")
shell: Rscript {0}

- name: Test coverage
Expand Down
17 changes: 16 additions & 1 deletion vignettes/ipums-bigdata.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,21 @@ installed_biglm <- requireNamespace("biglm")
installed_db_pkgs <- requireNamespace("DBI") &
requireNamespace("RSQLite") &
requireNamespace("dbplyr")
# Suppress certain chunks when on CRAN, as they may fail due to
# bug in vroom 1.6.4 that interacts with RSQLite and DBI
# (https://github.com/tidyverse/vroom/issues/519).
#
# Until bug is fixed in vroom, we do not want vignette check failures
# on CRAN that are out of our control, so we suppress output from these chunks
#
# Developers can use dev version of RSQLite to avoid errors. To run the chunks
# if you have the appropriate version of RSQLite installed, set the
# `NOT_CRAN` environment variable equal to `"true"`.
#
# TODO: remove when vroom is fixed
installed_db_pkgs <- installed_db_pkgs &&
isTRUE(as.logical(Sys.getenv("NOT_CRAN", "false")))
```

```{r, echo=FALSE}
Expand Down Expand Up @@ -619,7 +634,7 @@ query, but the data still exist only in the database. You can use
current R session. However, this would omit the variable metadata
attached to IPUMS data, since the database doesn't store this metadata:

```{r}
```{r, eval=installed_db_pkgs}
data <- example %>%
filter("AGE" > 25) %>%
collect()
Expand Down

0 comments on commit 5a4c055

Please sign in to comment.