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!: Rename struct fields of rle output to len/value and update data type of len field #15249

Merged
merged 2 commits into from
Jun 4, 2024

Conversation

stinodego
Copy link
Member

@stinodego stinodego commented Mar 23, 2024

Closes #15230

Changes

  • The struct fields of the rle method have been renamed from lengths/values to len/value.
  • The data type of the len field has been updated to match the index type (was previously Int32, now UInt32).

Example

Before

>>> s = pl.Series(["a", "a", "b", "c", "c", "c"])
>>> s.rle().struct.unnest()
shape: (3, 2)
┌─────────┬────────┐
│ lengths ┆ values │
│ ---     ┆ ---    │
│ i32     ┆ str    │
╞═════════╪════════╡
│ 2       ┆ a      │
│ 1       ┆ b      │
│ 3       ┆ c      │
└─────────┴────────┘

After

>>> s.rle().struct.unnest()
shape: (3, 2)
┌─────┬───────┐
│ len ┆ value │
│ --- ┆ ---   │
│ u32 ┆ str   │
╞═════╪═══════╡
│ 2   ┆ a     │
│ 1   ┆ b     │
│ 3   ┆ c     │
└─────┴───────┘

@stinodego stinodego added the do not merge This pull requests should not be merged right now label Mar 23, 2024
@stinodego stinodego added this to the 1.0.0 milestone Mar 23, 2024
@github-actions github-actions bot added breaking Change that breaks backwards compatibility enhancement New feature or an improvement of an existing feature python Related to Python Polars rust Related to Rust Polars labels Mar 23, 2024
@stinodego stinodego force-pushed the breaking-rle-struct-field-names branch from 25ece68 to 695611c Compare March 23, 2024 06:55
@stinodego stinodego marked this pull request as ready for review March 23, 2024 07:10
Copy link

codecov bot commented Mar 23, 2024

Codecov Report

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

Project coverage is 81.29%. Comparing base (e63e6fa) to head (695611c).

Files Patch % Lines
crates/polars-ops/src/series/ops/rle.rs 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15249      +/-   ##
==========================================
- Coverage   81.30%   81.29%   -0.01%     
==========================================
  Files        1356     1356              
  Lines      175680   175681       +1     
  Branches     2522     2522              
==========================================
- Hits       142829   142827       -2     
- Misses      32368    32370       +2     
- Partials      483      484       +1     

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

@stinodego stinodego removed this from the 1.0.0 milestone May 23, 2024
@stinodego stinodego merged commit c5f8117 into main Jun 4, 2024
25 checks passed
@stinodego stinodego deleted the breaking-rle-struct-field-names branch June 4, 2024 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Change that breaks backwards compatibility do not merge This pull requests should not be merged right now 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.

Rename rle() struct fields to len and value
1 participant