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

Prepare for switch to Andromeda-arrow #179

Draft
wants to merge 9 commits into
base: develop
Choose a base branch
from
Draft

Prepare for switch to Andromeda-arrow #179

wants to merge 9 commits into from

Conversation

ablack3
Copy link
Contributor

@ablack3 ablack3 commented Oct 19, 2022

@anthonysena, I had to make a few changes to FeatureExtraction to get tests passing with the Arrow branch.

One thing I need help with is to know how to update the data in inst/testdata. How is this data created? Can you add a script in extras/ that I can run to update the data. I'm assuming it takes a while to create the testdata which is why it is not created on the fly.


# local work folder
work/
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just for my convenience. I like to have an ignored folder where I can store work in progress.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can delete this if you like.

@@ -129,13 +129,13 @@ setMethod("show", "CovariateData", function(object) {
setMethod("summary", "CovariateData", function(object) {
covariateValueCount <- 0
if (!is.null(object$covariates)) {
covariateValueCount <- covariateValueCount + (object$covariates %>% count() %>% pull())
covariateValueCount <- covariateValueCount + (nrow(object$covariates))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change from count() %>% pull() to nrow() won't work with both versions of Andromeda so I might need to add a function to Andromeda that will work with both arrow filesystemdatasets and sqlite tbl references.

@@ -63,8 +63,6 @@ test_that("test saveCovariateData", {
expect_error(saveCovariateData()) #empty call error
expect_error(saveCovariateData(covariateData)) #no file error
expect_error(saveCovariateData(errCovData, file = saveFileTest)) #non covariateData class error
expect_message(saveCovariateData(covariateData, file = saveFileTest),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new version of andromeda does not disconnect on save.

@@ -34,7 +34,7 @@ test_that("filterByCohortDefinitionId works", {

test_that("filterByCohortDefinitionId handles locally aggregated data", {
locallyAggregated <- aggregateCovariates(covariateData)
expect_error(filterByCohortDefinitionId(locallyAggregated, 1), "no such column")
expect_error(filterByCohortDefinitionId(locallyAggregated, 1))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still catches the error message but the message text is different.

@@ -60,11 +60,11 @@ runSpotChecks <- function(connectionDetails, cdmDatabaseSchema, ohdsiDatabaseSch
results <- results[order(results$rowId), ]

covariateIds <- covariateData$covariateRef %>%
filter(rlang::sym("analysisId") == 1) %>%
select(rlang::sym("covariateId"))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this syntax doesn't work with arrow. The change should work with both the old and new versions.

@@ -15,8 +15,8 @@ test_that("Test stdDiff continuous variable computation", {
# FeatureExtraction::saveCovariateData(data, "inst/testdata/continuousCovariateData.zip")
# ------------------------------------------------------------------------------


data <- loadCovariateData(getTestResourceFilePath("continuousCovariateData.zip"))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason this function was causing problems with devtools::test(). Inlining the system.file call fixed it.

@@ -1,15 +1,17 @@
# Download the JDBC drivers used in the tests

oldJarFolder <- Sys.getenv("DATABASECONNECTOR_JAR_FOLDER")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a few changes to the setup file for efficiency.

Admin_mschuemi added 4 commits March 14, 2023 03:48
@codecov
Copy link

codecov bot commented Mar 28, 2023

Codecov Report

Merging #179 (cef8629) into develop (5363f5f) will decrease coverage by 0.40%.
The diff coverage is 90.32%.

@@             Coverage Diff             @@
##           develop     #179      +/-   ##
===========================================
- Coverage    93.47%   93.08%   -0.40%     
===========================================
  Files           15       15              
  Lines         1165     1171       +6     
===========================================
+ Hits          1089     1090       +1     
- Misses          76       81       +5     
Impacted Files Coverage Δ
R/HelperFunctions.R 87.23% <71.42%> (-7.77%) ⬇️
R/CovariateData.R 88.15% <80.00%> (ø)
R/Aggregation.R 98.61% <100.00%> (-1.39%) ⬇️
R/CompareCohorts.R 95.06% <100.00%> (ø)
R/GetCovariates.R 89.85% <100.00%> (ø)
R/Normalization.R 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@anthonysena
Copy link
Collaborator

@ablack3 thanks for making these changes. Based on the HADES call yesterday, I'm going to mark this PR as a draft in the event we want to come back to the Arrow implementation. Thanks!

@anthonysena anthonysena marked this pull request as draft May 19, 2023 14:19
@ablack3
Copy link
Contributor Author

ablack3 commented May 19, 2023

Yea sounds good. I'm hopeful that we'll be using arrow at some point but there are some issues that need to get worked out in arrow first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants