GEMINI-Medicine / Rgemini

A custom R package that provides a variety of functions to perform data analyses with GEMINI data
https://gemini-medicine.github.io/Rgemini/
Other
3 stars 0 forks source link

74 bug input check #75

Closed loffleraSMH closed 6 months ago

loffleraSMH commented 7 months ago

Fixed the bug described in the issue and added a new unit test to check for the scenario causing the bug in the previous version of the function.

An easy way to check the old vs. new function is to try running this code - the old version will return an error, whereas the fixed version should run smoothly: check_input(data.table(discharge_date_time = lubridate::ymd_hm('2020-01-01 00:00')), c("data.frame", "data.table"), colnames = c("discharge_date_time"), coltypes = c("POSIXct"))

loffleraSMH commented 6 months ago

data <- data.table::data.table(discharge_date_time = lubridate::ymd_hm('2020-01-01 00:00')) Rgemini:::check_input(data, c("data.frame", "data.table"), colnames = c("discharge_date_time"), coltypes = c("POSIXt"))

Thanks for reviewing this so quickly @vaakesan-SMH! Oh interesting, both examples fail for me on master. But yes, as long as both checks pass on the new version, that's great - so I'll go ahead and merge this.