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: Bitwise operations / aggregations #18994

Merged
merged 9 commits into from
Oct 1, 2024

Conversation

coastalwhite
Copy link
Collaborator

@coastalwhite coastalwhite commented Sep 28, 2024

This implements the bitwise namespace for expressions that allows performing bitwise operations on booleans, integers and floating point values. This also allows for bitwise aggregations.

List of implemented functions:

  • bitwise_count_ones
  • bitwise_count_zeros
  • bitwise_leading_ones
  • bitwise_leading_zeros
  • bitwise_trailing_ones
  • bitwise_trailing_zeros
  • bitwise_and
  • bitwise_or
  • bitwise_xor

This implements the `bitwise` namespace for expressions that allows performing
bitwise operations on booleans, integers and floating point values. This also
allows for bitwise aggregations.

List of implemented functions:

- [x] `bitwise.count_ones`
- [x] `bitwise.count_zeros`
- [x] `bitwise.leading_ones`
- [x] `bitwise.leading_zeros`
- [x] `bitwise.trailing_ones`
- [x] `bitwise.trailing_zeros`
- [ ] `bitwise.and`
- [ ] `bitwise.or`
- [ ] `bitwise.xor`

[skip ci]
@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 Sep 28, 2024
@ritchie46
Copy link
Member

I think we can skip that test on py39. :')

Copy link

codecov bot commented Sep 30, 2024

Codecov Report

Attention: Patch coverage is 57.10145% with 296 lines in your changes missing coverage. Please review.

Project coverage is 79.78%. Comparing base (901b243) to head (995526d).
Report is 54 commits behind head on main.

Files with missing lines Patch % Lines
crates/polars-compute/src/bitwise/mod.rs 67.85% 63 Missing ⚠️
.../polars-core/src/series/implementations/boolean.rs 0.00% 57 Missing ⚠️
...rs-core/src/frame/group_by/aggregations/boolean.rs 0.00% 33 Missing ⚠️
...olars-core/src/chunked_array/ops/bitwise_reduce.rs 50.00% 30 Missing ⚠️
...s/polars-core/src/series/implementations/floats.rs 0.00% 27 Missing ⚠️
crates/polars-core/src/series/series_trait.rs 0.00% 18 Missing ⚠️
...rates/polars-plan/src/dsl/function_expr/bitwise.rs 74.57% 15 Missing ⚠️
crates/polars-core/src/frame/group_by/mod.rs 0.00% 10 Missing ⚠️
...polars-core/src/frame/group_by/aggregations/mod.rs 75.67% 9 Missing ⚠️
.../polars-python/src/lazyframe/visitor/expr_nodes.rs 0.00% 9 Missing ⚠️
... and 7 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #18994      +/-   ##
==========================================
- Coverage   79.88%   79.78%   -0.11%     
==========================================
  Files        1524     1531       +7     
  Lines      207634   208487     +853     
  Branches     2904     2913       +9     
==========================================
+ Hits       165873   166343     +470     
- Misses      41214    41593     +379     
- Partials      547      551       +4     

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

@ritchie46 ritchie46 marked this pull request as ready for review October 1, 2024 14:33
@ritchie46 ritchie46 merged commit a2d00f1 into pola-rs:main Oct 1, 2024
26 checks passed
@coastalwhite coastalwhite deleted the feat/bitwise-ops branch October 1, 2024 18:18
@c-peters c-peters added the accepted Ready for implementation label Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Ready for implementation enhancement New feature or an improvement of an existing feature python Related to Python Polars rust Related to Rust Polars
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants