Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn when converting Arrow.Timestamps to Dates.DateTime or ZonedDateTime #172

Merged
merged 1 commit into from
Apr 13, 2021

Conversation

quinnj
Copy link
Member

@quinnj quinnj commented Apr 13, 2021

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.

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.
@codecov
Copy link

codecov bot commented Apr 13, 2021

Codecov Report

Merging #172 (83afdc9) into main (4876810) will increase coverage by 0.05%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #172      +/-   ##
==========================================
+ Coverage   81.30%   81.36%   +0.05%     
==========================================
  Files          25       25              
  Lines        3017     3021       +4     
==========================================
+ Hits         2453     2458       +5     
+ Misses        564      563       -1     
Impacted Files Coverage Δ
src/eltypes.jl 87.45% <100.00%> (+0.18%) ⬆️
src/FlatBuffers/FlatBuffers.jl 66.66% <0.00%> (+1.28%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4876810...83afdc9. Read the comment docs.

@quinnj quinnj merged commit 2909821 into main Apr 13, 2021
@quinnj quinnj deleted the jq/nano branch April 13, 2021 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MethodError Int64(::Arrow.Timestamp... when reading arrow file saved by pandas.
1 participant