Skip to content

Commit

Permalink
Apparently also need workaround for read_csv
Browse files Browse the repository at this point in the history
  • Loading branch information
schuemie committed Nov 14, 2023
1 parent 2d5f6a5 commit c944742
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions R/Export.R
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ enforceMinCellValue <- function(data, fieldName, minValues, silent = FALSE) {
}

createEmptyResult <- function(tableName) {
# Workaround for issue https://github.com/tidyverse/vroom/issues/519:
readr::local_edition(1)
columns <- readr::read_csv(
file = system.file("csv", "resultsDataModelSpecification.csv", package = "CohortMethod"),
show_col_types = FALSE) %>%
Expand Down
2 changes: 2 additions & 0 deletions R/ResultsDataModel.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#' @export
getResultsDataModelSpecifications <- function() {
pathToCsv <- system.file("csv", "resultsDataModelSpecification.csv", package = utils::packageName())
# Workaround for issue https://github.com/tidyverse/vroom/issues/519:
readr::local_edition(1)
resultsDataModelSpecifications <- readr::read_csv(file = pathToCsv, col_types = readr::cols())
colnames(resultsDataModelSpecifications) <- SqlRender::snakeCaseToCamelCase(colnames(resultsDataModelSpecifications))
return(resultsDataModelSpecifications)
Expand Down
2 changes: 2 additions & 0 deletions R/Table1.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ getDefaultCmTable1Specifications <- function() {
analysisId = readr::col_integer(),
covariateIds = readr::col_character()
)
# Workaround for issue https://github.com/tidyverse/vroom/issues/519:
readr::local_edition(1)
specifications <- readr::read_csv(fileName, col_types = colTypes)
return(specifications)
}
Expand Down
2 changes: 2 additions & 0 deletions R/Viewer.R
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ uploadExportedResults <- function(connectionDetails,
})
})
rdmsFile <- system.file("csv", "resultsDataModelSpecification.csv", package = "CohortMethod")
# Workaround for issue https://github.com/tidyverse/vroom/issues/519:
readr::local_edition(1)
specification <- readr::read_csv(file = rdmsFile, show_col_types = FALSE) %>%
SqlRender::snakeCaseToCamelCaseNames()

Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-eunomia.R
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ test_that("Multiple analyses", {
cohortMethodResultFile <- file.path(outputFolder, "export", "cm_result.csv")
expect_true(file.exists(cohortMethodResultFile))

# Workaround for issue https://github.com/tidyverse/vroom/issues/519:
readr::local_edition(1)
diagnosticsSummary <- readr::read_csv(file.path(outputFolder, "export", "cm_diagnostics_summary.csv"), show_col_types = FALSE)
expect_true(all(diagnosticsSummary$ease_diagnostic == "NOT EVALUATED"))

Expand Down

0 comments on commit c944742

Please sign in to comment.