Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add readr local edition downgrade #495

Merged
merged 2 commits into from
Oct 18, 2023
Merged
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
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