Closed wence- closed 1 week ago
This is a bit fiddly since std::chrono
specifies that the minimum and maximum values of representable year
s are $-2^{15}$ and $2^{15} - 1$ respectively. So given the manipulations rely on cuda::std::chrono
, this may not be fixable.
libcudf will not likely support date/time functions outside what std::chrono
or cuda::std::chrono
supports.
Also, I believe leap seconds are supposed to account for the speed up of the earth's rotation.
I'm happy to wontfix this one.
[Aside: Yes, leap seconds do fix this, but we don't know about them until they happen, so the answer panda returns is correct "now", but the answer obtained now might be wrong once that date rolls round :)]
Closing based on the above discussion.
Describe the bug
libcudf's
cudf::datetime::extract_year
returns an INT16 column, this can lose information for large positive or negative years.The date32 type is:
The timestamp types are (for resolutions milli-, micro-, and nano-seconds):
The must positive year representable by the date32 type is (approximately) $1970 + (2^{31} - 1)/365 \approx 5885486 \gg 2^{15} - 1$.
Similarly the most positive year representable by the timestamp64[ms] and timestamp64[us] types is respectively approximately 292473178 and 294441. Both of which are again larger than $2^{15} - 1$.
Steps/Code to reproduce bug
Expected behavior
We should produce the right answer. This might be doable by returning an INT32 column for year extraction.