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

feat!: Enforce deprecation of offset arg in truncate and round #16655

Merged
merged 5 commits into from
Jun 4, 2024

Conversation

MarcoGorelli
Copy link
Collaborator

@MarcoGorelli MarcoGorelli commented Jun 1, 2024

This simplifies quite a lot

This will make perf improvements for truncate and round easier

Adding "do not merge" for now, until it's finalised that it's time to merge things for 1.0

@MarcoGorelli MarcoGorelli added this to the 1.0.0 milestone Jun 1, 2024
@github-actions github-actions bot added enhancement New feature or an improvement of an existing feature python Related to Python Polars rust Related to Rust Polars labels Jun 1, 2024
@MarcoGorelli MarcoGorelli changed the title feat: enforce deprecation of offset arg in truncate and round feat!: enforce deprecation of offset arg in truncate and round Jun 1, 2024
@MarcoGorelli MarcoGorelli added the do not merge This pull requests should not be merged right now label Jun 1, 2024
@github-actions github-actions bot added the breaking Change that breaks backwards compatibility label Jun 1, 2024
Comment on lines 64 to -67
pub fn truncate_ns(&self, t: i64, tz: Option<&Tz>) -> PolarsResult<i64> {
let t = self.every.truncate_ns(t, tz)?;
self.offset.add_ns(t, tz)
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i was never a huge fan how of truncate_* would both truncate and apply an offset..

Copy link

codecov bot commented Jun 1, 2024

Codecov Report

Attention: Patch coverage is 88.57143% with 4 lines in your changes missing coverage. Please review.

Project coverage is 81.54%. Comparing base (9912af0) to head (2f01f94).
Report is 17 commits behind head on main.

Current head 2f01f94 differs from pull request most recent head cf3cd37

Please upload reports for the commit cf3cd37 to get more accurate results.

Files Patch % Lines
...ates/polars-plan/src/dsl/function_expr/datetime.rs 83.33% 2 Missing ⚠️
py-polars/src/lazyframe/visitor/expr_nodes.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16655      +/-   ##
==========================================
+ Coverage   81.49%   81.54%   +0.04%     
==========================================
  Files        1416     1414       -2     
  Lines      186880   186349     -531     
  Branches     3023     3010      -13     
==========================================
- Hits       152289   151949     -340     
+ Misses      34059    33870     -189     
+ Partials      532      530       -2     

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

@MarcoGorelli MarcoGorelli marked this pull request as ready for review June 1, 2024 14:41
@ritchie46
Copy link
Member

Good to go. Can you rebase?

@stinodego stinodego removed the do not merge This pull requests should not be merged right now label Jun 4, 2024
@ritchie46 ritchie46 merged commit 48d0a6c into pola-rs:main Jun 4, 2024
26 checks passed
@stinodego stinodego changed the title feat!: enforce deprecation of offset arg in truncate and round feat!: Enforce deprecation of offset arg in truncate and round Jun 11, 2024
@stinodego stinodego removed the breaking Change that breaks backwards compatibility label Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or an improvement of an existing feature python Related to Python Polars rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants