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 cat.slice #21971

Merged
merged 3 commits into from
Apr 1, 2025
Merged

feat: Add cat.slice #21971

merged 3 commits into from
Apr 1, 2025

Conversation

mcrumiller
Copy link
Contributor

As with the other categorical string operations this doesn't allow expression input, as that would negate the whole benefit from performing the operation on categoricals.

>>> import polars as pl
>>> s = pl.Series(["foobar", "barfoo", "x", None], dtype=pl.Categorical)
>>> s.cat.slice(1, 3)
shape: (4,)
Series: '' [str]
[
        "oob"
        "arf"
        ""
        null
]

@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 Mar 28, 2025
Copy link

codecov bot commented Mar 28, 2025

Codecov Report

Attention: Patch coverage is 97.72727% with 1 line in your changes missing coverage. Please review.

Project coverage is 80.47%. Comparing base (10dd3dc) to head (b29fccd).
Report is 15 commits behind head on main.

Files with missing lines Patch % Lines
crates/polars-plan/src/dsl/function_expr/cat.rs 96.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #21971      +/-   ##
==========================================
- Coverage   80.47%   80.47%   -0.01%     
==========================================
  Files        1636     1636              
  Lines      236598   236626      +28     
  Branches     2693     2693              
==========================================
+ Hits       190413   190428      +15     
- Misses      45551    45564      +13     
  Partials      634      634              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mcrumiller mcrumiller marked this pull request as ready for review March 28, 2025 20:36
@orlp orlp merged commit 8dd5382 into pola-rs:main Apr 1, 2025
27 checks passed
@orlp
Copy link
Collaborator

orlp commented Apr 1, 2025

Thanks :)

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