From 91cb457d88c8bf08f129ab8b4ef2ae87e216faee Mon Sep 17 00:00:00 2001 From: Admin_mschuemi Date: Wed, 11 Dec 2024 03:04:12 -0500 Subject: [PATCH 1/2] Support BIGINT person IDs --- NEWS.md | 1 + R/CreateCohortExplorerApp.R | 23 +++++++---------------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/NEWS.md b/NEWS.md index a603fbe..c9847e5 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,7 @@ CohortExplorer 0.1.1 ====================== Improve test coverage to 100% Force creation of .Rproj file for shiny app. +Support BIGINT person IDs. CohortExplorer 0.1.0 diff --git a/R/CreateCohortExplorerApp.R b/R/CreateCohortExplorerApp.R index af60c6c..39c1636 100644 --- a/R/CreateCohortExplorerApp.R +++ b/R/CreateCohortExplorerApp.R @@ -172,23 +172,14 @@ createCohortExplorerApp <- function(connectionDetails = NULL, add = errorMessage ) - if (is.null(personIds)) { - checkmate::assertIntegerish( - x = sampleSize, - lower = 0, - len = 1, - null.ok = TRUE, + # personIds can be interger, numeric, or character to allow bigint (R does not + # support 64-bit integers): + if (!is.null(personIds)) { + checkmate::assertTRUE( + all(grepl("[0-9]+", as.character(personIds))), add = errorMessage ) - } else { - checkmate::assertIntegerish( - x = personIds, - lower = 0, - min.len = 1, - null.ok = TRUE - ) } - exportFolder <- normalizePath(exportFolder, mustWork = FALSE) dir.create( @@ -331,7 +322,7 @@ createCohortExplorerApp <- function(connectionDetails = NULL, progressBar = TRUE, bulkLoad = (Sys.getenv("bulkLoad") == TRUE), camelCaseToSnakeCase = TRUE, - data = dplyr::tibble(subjectId = as.double(personIds) |> unique()) + data = dplyr::tibble(subjectId = as.character(personIds) |> unique()) ) DatabaseConnector::renderTranslateExecuteSql( @@ -341,7 +332,7 @@ createCohortExplorerApp <- function(connectionDetails = NULL, INTO #person_id_data2 FROM #person_id_data a INNER JOIN #persons_to_filter b - ON a.subject_id = b.subject_id; + ON CAST(a.subject_id AS BIGINT) = CAST(b.subject_id AS BIGINT); DROP TABLE IF EXISTS #person_id_data; SELECT DISTINCT subject_id From 85d195c32e73b6446bc2b67f45bf1249a118f4e3 Mon Sep 17 00:00:00 2001 From: Admin_mschuemi Date: Wed, 11 Dec 2024 03:42:33 -0500 Subject: [PATCH 2/2] Updating GitHub Actions script --- .github/workflows/R_CMD_check_Hades.yaml | 29 ++++++++++++++++++------ 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/.github/workflows/R_CMD_check_Hades.yaml b/.github/workflows/R_CMD_check_Hades.yaml index 5068891..8d07fa6 100644 --- a/.github/workflows/R_CMD_check_Hades.yaml +++ b/.github/workflows/R_CMD_check_Hades.yaml @@ -53,7 +53,7 @@ jobs: CDM5_SPARK_CONNECTION_STRING: ${{ secrets.CDM5_SPARK_CONNECTION_STRING }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: r-lib/actions/setup-r@v2 with: @@ -86,22 +86,37 @@ jobs: - name: Upload source package if: success() && runner.os == 'macOS' && github.event_name != 'pull_request' && github.ref == 'refs/heads/main' - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: package_tarball path: check/*.tar.gz - name: Install covr - if: runner.os == 'macOS' + if: runner.os == 'Linux' run: | - install.packages("covr") + remotes::install_cran("covr") + remotes::install_cran("xml2") shell: Rscript {0} - + - name: Test coverage - if: runner.os == 'macOS' - run: covr::codecov() + if: runner.os == 'Linux' + run: | + cov <- covr::package_coverage( + quiet = FALSE, + clean = FALSE, + install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") + ) + covr::to_cobertura(cov) shell: Rscript {0} + - uses: codecov/codecov-action@v4 + if: runner.os == 'Linux' + with: + file: ./cobertura.xml + plugin: noop + disable_search: true + token: ${{ secrets.CODECOV_TOKEN }} + Release: needs: R-CMD-Check