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: add holidays argument to business_day_count #15580

Merged
merged 5 commits into from
Apr 12, 2024

Conversation

MarcoGorelli
Copy link
Collaborator

Business polars: part 3 of 5

Is there a better way to pass the list of holidays on from Python to Rust?

@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 Apr 10, 2024
Copy link

codspeed-hq bot commented Apr 10, 2024

CodSpeed Performance Report

Merging #15580 will improve performances by 22.86%

Comparing MarcoGorelli:business-holidays (f24eb36) with main (23791bd)

Summary

⚡ 1 improvements
✅ 21 untouched benchmarks

Benchmarks breakdown

Benchmark main MarcoGorelli:business-holidays Change
test_windows_not_cached 3.5 s 2.9 s +22.86%

crates/polars-ops/src/series/ops/business.rs Outdated Show resolved Hide resolved
let mut holidays: Vec<i32> = holidays
.iter()
.filter(|&x| *unsafe { week_mask.get_unchecked(weekday(*x)) })
.cloned()
Copy link
Member

Choose a reason for hiding this comment

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

This should be copied?

crates/polars-ops/src/series/ops/business.rs Outdated Show resolved Hide resolved
crates/polars-ops/src/series/ops/business.rs Outdated Show resolved Hide resolved
Copy link

codecov bot commented Apr 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.12%. Comparing base (835d198) to head (59930b2).
Report is 10 commits behind head on main.

❗ Current head 59930b2 differs from pull request most recent head f24eb36. Consider uploading reports for the commit f24eb36 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15580      +/-   ##
==========================================
+ Coverage   81.11%   81.12%   +0.01%     
==========================================
  Files        1367     1367              
  Lines      174934   174981      +47     
  Branches     2530     2531       +1     
==========================================
+ Hits       141890   141946      +56     
+ Misses      32569    32559      -10     
- Partials      475      476       +1     

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

Copy link
Member

@ritchie46 ritchie46 left a comment

Choose a reason for hiding this comment

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

Left one comment on the unsafe tag. After that it is good to go. :)

crates/polars-ops/src/series/ops/business.rs Show resolved Hide resolved
@MarcoGorelli MarcoGorelli merged commit 0b84b14 into pola-rs:main Apr 12, 2024
24 checks passed
@MarcoGorelli
Copy link
Collaborator Author

thanks for your review! 🙏
shipping it then to move forwards with the next one

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.

2 participants