Warn when converting Arrow.Timestamps to Dates.DateTime or ZonedDateTime (#172)
authorJacob Quinn <quinn.jacobd@gmail.com>
Tue, 13 Apr 2021 14:56:27 +0000 (08:56 -0600)
committerGitHub <noreply@github.com>
Tue, 13 Apr 2021 14:56:27 +0000 (08:56 -0600)
commit2909821738a2d49b7a540764dae93d6fc88e068b
treed43eb3963f522d434f042abb463772100c7a5c6a
parent48768102350bc034bc0808be0a06a260bd797426
Warn when converting Arrow.Timestamps to Dates.DateTime or ZonedDateTime (#172)

Fixes #166. The problem OP saw in the original issue was that we didn't
have a proper `ArrowTypes.fromarrow` method defined for `Dates.DateTime`
from `Arrow.Timestamp` with nanosecond precision, which is accurate in
one sense because `Dates.DateTime` only supports up to millisecond
precision. But better than just erroring when trying to access these
values later, we now do the conversion anyway, which may be lossy, and
issue a warning about the potentially lossy conversion. If > millisecond
precision is needed, then users should pass `convert=false` and operate
on the `Arrow.Timestamp` values directly for now.
src/eltypes.jl
test/runtests.jl