docs(python): Clarify null handling in unique operations#27431
Merged
orlp merged 1 commit intopola-rs:mainfrom Apr 28, 2026
Merged
docs(python): Clarify null handling in unique operations#27431orlp merged 1 commit intopola-rs:mainfrom
orlp merged 1 commit intopola-rs:mainfrom
Conversation
orlp
requested changes
Apr 28, 2026
| >>> df = pl.DataFrame( | ||
| ... { | ||
| ... "a": [1, 8, 1], | ||
| ... "a": [1, 8, None], |
Member
There was a problem hiding this comment.
This example now is missing a duplicate value. Can you make it 1, 1, None?
Contributor
Author
There was a problem hiding this comment.
Good catch, updated the example to keep a duplicate value while including None. Thanks
0087580 to
2ae7877
Compare
orlp
approved these changes
Apr 28, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #27431 +/- ##
==========================================
- Coverage 81.19% 79.55% -1.64%
==========================================
Files 1832 1836 +4
Lines 253247 254204 +957
Branches 3176 3177 +1
==========================================
- Hits 205626 202237 -3389
- Misses 46798 51143 +4345
- Partials 823 824 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #7770.
Summary
Clarifies that
nullis considered a unique value in Python API documentation for unique operations.Updated docs for:
Series.uniqueSeries.n_uniqueExpr.uniquepl.n_uniqueAlso updates the
pl.n_uniqueandSeries.n_uniqueexamples to includeNone.Validation
git diff --check ruff check py-polars/src/polars/series/series.py py-polars/src/polars/expr/expr.py py-polars/src/polars/functions/lazy.py python -m pytest \ py-polars/tests/unit/operations/unique/test_n_unique.py \ py-polars/tests/unit/operations/unique/test_unique.py \ -k "n_unique or unique"