-
Notifications
You must be signed in to change notification settings - Fork 78
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
Fix bug with conversion of Timestamp::Microseconds to chrono::Datetime #134
Conversation
FYI
|
Yeah don't worry about warnings you didn't introduce. Please run rustfmt though. I was gonna comment that we should probably use the |
Oh wow we even had a broken test case for micros. I guess you'll need to fix/remove that one. |
I could see that the
So since we know, what precision each type has (e.g. Timestamp::milliseconds for sure has ms precision), probably we can call those |
Yeah, I did not remove it, since did not know, if somebody needed it for some reason... I can remove it if you want |
Well the test divides 1 by some number greater than 1, so it gets integer'ed to 0. Looks to me like the test was just as broken as the impl. I'd probably just replace the existing test with your new test. |
Also please remove the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
Also, as I mentioned, opt with unwrap to fix this clippy warning, like this fn from(date_time: DateTime<T>) -> Self {
Timestamp::Nanoseconds(date_time.timestamp_nanos_opt().unwrap() as u128)
} |
Influxdb 0.7.2 has been released with this fix. |
Thanks for letting me know! Will be happy to use the correct impl :) |
p.s. I've seen that you have also corrected the impl |
Yeah I knew that was a thing and easy to fix I'd just been too lazy to do that until now 😅 |
Description
Fix bug with the conversion of Timestamp::Microseconds to chrono::Datetime
Fix for issue #133
Checklist
cargo fmt --all
cargo clippy --manifest-path influxdb/Cargo.toml --all-targets --no-default-features --features use-serde,derive,reqwest-client -- -D warnings
cargo clippy --manifest-path influxdb/Cargo.toml --all-targets --no-default-features --features use-serde,derive,hyper-client -- -D warnings
cargo doc2readme -p influxdb --expand-macros