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

chore: make Duration.is_constant_duration less strict for non-timezone-aware case #15639

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

MarcoGorelli
Copy link
Collaborator

@MarcoGorelli MarcoGorelli commented Apr 13, 2024

splitting this off from #15638

There's currently a method Duration.is_constant_duration, which returns false if the duration contains calendar durations (months, weeks, days).
However, for the time-zone-naive case (and the UTC case), days and weeks are constant durations too, as they're not affected by daylight saving time

There's no implication for the current tests (but it will help with #15638, as there half_life has to be a constant duration)

@github-actions github-actions bot added internal An internal refactor or improvement python Related to Python Polars rust Related to Rust Polars labels Apr 13, 2024
@MarcoGorelli MarcoGorelli changed the title chore: simplify Duration.is_constant_duration usage chore: make Duration.is_constant_duration less strict for non-timezone-aware case Apr 13, 2024
@MarcoGorelli MarcoGorelli marked this pull request as ready for review April 13, 2024 18:58
Copy link

codspeed-hq bot commented Apr 13, 2024

CodSpeed Performance Report

Merging #15639 will not alter performance

Comparing MarcoGorelli:simplify-is-constant-duration (019ff08) with main (4eef5b5)

Summary

✅ 22 untouched benchmarks

Copy link

codecov bot commented Apr 13, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 81.30%. Comparing base (7341aee) to head (019ff08).

Files Patch % Lines
crates/polars-time/src/windows/duration.rs 75.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #15639   +/-   ##
=======================================
  Coverage   81.30%   81.30%           
=======================================
  Files        1373     1373           
  Lines      176243   176245    +2     
  Branches     2544     2544           
=======================================
+ Hits       143293   143299    +6     
+ Misses      32466    32463    -3     
+ Partials      484      483    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ritchie46 ritchie46 merged commit 6e1620b into pola-rs:main Apr 15, 2024
20 checks passed
@ritchie46
Copy link
Member

Don't see us going in the less strict one often. ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal An internal refactor or improvement python Related to Python Polars rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants