Skip to content

Prepare for switch to Andromeda-arrow#179

Draft
ablack3 wants to merge 9 commits intodevelopfrom
arrow_S4
Draft

Prepare for switch to Andromeda-arrow#179
ablack3 wants to merge 9 commits intodevelopfrom
arrow_S4

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.

.Renviron

# 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.

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.

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.

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.


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.

# ------------------------------------------------------------------------------


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

❌ Patch coverage is 90.32258% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.08%. Comparing base (5363f5f) to head (cef8629).
⚠️ Report is 240 commits behind head on develop.

Files with missing lines Patch % Lines
R/HelperFunctions.R 71.42% 2 Missing ⚠️
R/CovariateData.R 80.00% 1 Missing ⚠️
Additional details and impacted files
@@             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     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@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