Skip to content

Commit

Permalink
Merge pull request #495 from katy-sadowski/katy__vroom_fix
Browse files Browse the repository at this point in the history
Add readr local edition downgrade
  • Loading branch information
katy-sadowski authored Oct 18, 2023
2 parents b1eb194 + ca1a941 commit cd5bd33
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 4 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ importFrom(jsonlite,fromJSON)
importFrom(jsonlite,parse_json)
importFrom(jsonlite,toJSON)
importFrom(magrittr,"%>%")
importFrom(readr,local_edition)
importFrom(readr,read_csv)
importFrom(rlang,.data)
importFrom(stats,na.omit)
Expand Down
4 changes: 4 additions & 0 deletions R/convertResultsCase.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#' @importFrom SqlRender snakeCaseToCamelCase camelCaseToSnakeCase
#' @importFrom dplyr rename_with
#' @importFrom tools file_path_sans_ext
#' @importFrom readr local_edition
#'
#' @export

Expand All @@ -46,6 +47,9 @@ convertJsonResultsFileCase <- function(
if (writeToFile && is.na(outputFolder)) {
stop("You must specify an output folder if writing to file.")
}

# temporary patch to work around vroom 1.6.4 bug
readr::local_edition(1)

results <- jsonlite::fromJSON(jsonFilePath)

Expand Down
5 changes: 4 additions & 1 deletion R/executeDqChecks.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
#' @importFrom utils packageVersion write.table
#' @importFrom rlang .data
#' @importFrom tidyselect all_of
#' @importFrom readr read_csv
#' @importFrom readr read_csv local_edition
#' @importFrom dplyr mutate case_when
#'
#' @export
Expand Down Expand Up @@ -118,6 +118,9 @@ executeDqChecks <- function(connectionDetails,
warning(sprintf("Missing check names to calculate the 'Not Applicable' status: %s", missingNACheckNames))
}
}

# temporary patch to work around vroom 1.6.4 bug
readr::local_edition(1)

# capture metadata -----------------------------------------------------------------------
if (!sqlOnly) {
Expand Down
6 changes: 5 additions & 1 deletion R/listChecks.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,14 @@
#' @param fieldCheckThresholdLoc The location of the threshold file for evaluating the field checks. If not specified the default thresholds will be applied.
#' @param conceptCheckThresholdLoc The location of the threshold file for evaluating the concept checks. If not specified the default thresholds will be applied.
#'
#' @importFrom readr read_csv
#' @importFrom readr read_csv local_edition
#'
#' @export
listDqChecks <- function(cdmVersion = "5.3", tableCheckThresholdLoc = "default", fieldCheckThresholdLoc = "default", conceptCheckThresholdLoc = "default") {

# temporary patch to work around vroom 1.6.4 bug
readr::local_edition(1)

dqChecks <- {}
dqChecks$checkDescriptions <-
read_csv(system.file(
Expand Down
2 changes: 1 addition & 1 deletion man/executeDqChecks.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/testthat/test-executeDqChecks.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
library(testthat)
local_edition(3)
testthat::local_edition(3)

test_that("Execute a single DQ check on Synthea/Eunomia", {
outputFolder <- tempfile("dqd_")
Expand Down

0 comments on commit cd5bd33

Please sign in to comment.