Closed loffleraSMH closed 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.
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"))