You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tried to remove the unwrap() like specify in the issue, but nano is an Option, so removing the unwrap just creates errors. So is it better to catch the error and return null or replacing unwrap() by unwrap_or_default() which return "1970-01-01T00:00:00"?
I got this timestamp by running this test in timestamps.slt
I've tried to remove the unwrap() like specify in the issue, but nano is an Option, so removing the unwrap just creates errors. So is it better to catch the error and return null or replacing unwrap() by unwrap_or_default() which return "1970-01-01T00:00:00"?
I think what is needed is to ignore nulls (so that null comes out)
something like nano.map(|nano| truncate(nano))
So rather than unwrap use map to only do the calculation of nano is non null
If you make a PR with some example code I can probably offer some more specific advice
Describe the bug
Calling the
date_trunc(null)
function results in a panicTo Reproduce
Expected behavior
null
should be returnedAdditional context
Found while reviewing #6654 from @Weijun-H
The issue is the use of
unwrap()
in thedate_trunc
implementationI think this is a good first issue for someone as it is localized (involves removing
unwrap()
) and writing some tests using .sltThe text was updated successfully, but these errors were encountered: