-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
Description
Describe the bug
cast_to_variant will panic for values of Date64 / Timestamp that can not be converted to NaiveDate
For example:
| |v: i64| { Date64Type::to_naive_date_opt(v).unwrap() }, |
And
| |v| NaiveTime::from_num_seconds_from_midnight_opt(v as u32, 0u32).unwrap(), |
To Reproduce
Pass in some value that is not representable as a NaiveDate (needs research to figure out what that could be)
It will panic
Expected behavior
I think we should have some way to specify what to do if the conversion fails, similar to the cast kernel which has a strict mode
if strict is true, then if the conversion fails an error is returned
If struct is false, then if the conversion fails, a Null is output
Additional context