-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Labels
Description
data.table loads dates as IDate. not an issue, as these can be simply converted to native Date with :=(as.Date())
problem is that the mode on these converted dates is still integer and this causes fcoalesce to puke
very annoying to have to micromanage this all over the place when mixing data sourced both from and not from fread
sort of feels like a self-own. Any way this could be made less cumbersome? maybe fcase special casing Date subclass comparisons?
data.table::fcoalesce(Sys.Date(), as.IDate("9999-12-31"))
#Error in data.table::fcoalesce(Sys.Date(), as.IDate("9999-12-31")) : Item 2 is type integer but the first item is type double. Please coerce before coalescing.
data.table::fcoalesce(Sys.Date(), as.Date(as.IDate("9999-12-31")))
#Error in data.table::fcoalesce(Sys.Date(), as.Date(as.IDate("9999-12-31"))) : Item 2 is type integer but the first item is type double. Please coerce before coalescing.
data.table::fcoalesce(Sys.Date(), as.Date(as.numeric(as.IDate("9999-12-31"))))
#[1] "2025-12-29"