-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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(python!): Default to raising on out-of-bounds indices in all get
/gather
operations
#16841
Conversation
get
/gather
operationsget
/gather
operations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Could you also add null_on_oob
to Expr/Series.get/gather
? Or keep the issue open for post-1.0.0?
At least the behavior is consistent now so we're set for 1.0.0 👍
Adding the functionality can be done later. Is very low priority AFAIC. |
Added a feature request. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #16841 +/- ##
==========================================
- Coverage 81.40% 81.39% -0.02%
==========================================
Files 1425 1425
Lines 187627 187627
Branches 2702 2702
==========================================
- Hits 152738 152717 -21
- Misses 34393 34414 +21
Partials 496 496 ☔ View full report in Codecov by Sentry. |
get
/gather
operationsget
/gather
operations
Closes #15240
The default behavior was inconsistent between
get
andgather
operations in various places. Now all such operations will raise by default.Pass
null_on_oob=True
to restore previous behavior.Example
Before:
After:
>>> s.list.get(1) Traceback (most recent call last): ... polars.exceptions.ComputeError: get index is out of bounds
Use instead: