jorgecarleitao / arrow2

Transmute-free Rust library to work with the Arrow format
Apache License 2.0
1.07k stars 223 forks source link

Don't calculate nanoseconds in timestamp conversion when remainder implies integer seconds #1471

Closed alexander-beedie closed 1 year ago

alexander-beedie commented 1 year ago

Optimisation for negative timestamp conversion; a remainder of zero implies that we have no nanosecond part, so can set directly - no need to calculate.

ritchie46 commented 1 year ago

I am going to let this one marinade for a few days. ;)

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.01 :warning:

Comparison is base (1491c6e) 83.93% compared to head (b116f9a) 83.93%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1471 +/- ## ========================================== - Coverage 83.93% 83.93% -0.01% ========================================== Files 387 387 Lines 41629 41629 ========================================== - Hits 34942 34940 -2 - Misses 6687 6689 +2 ``` | [Impacted Files](https://codecov.io/gh/jorgecarleitao/arrow2/pull/1471?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jorge+Leitao) | Coverage Δ | | |---|---|---| | [src/temporal\_conversions.rs](https://codecov.io/gh/jorgecarleitao/arrow2/pull/1471?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jorge+Leitao#diff-c3JjL3RlbXBvcmFsX2NvbnZlcnNpb25zLnJz) | `91.63% <100.00%> (ø)` | | ... and [2 files with indirect coverage changes](https://codecov.io/gh/jorgecarleitao/arrow2/pull/1471/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jorge+Leitao) Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jorge+Leitao). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jorge+Leitao)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.