-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
fix(rust): Fix str.to_integer
panics for certain inputs
#22243
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #22243 +/- ##
==========================================
- Coverage 80.78% 80.77% -0.01%
==========================================
Files 1639 1639
Lines 235548 235549 +1
Branches 2714 2714
==========================================
- Hits 190278 190270 -8
- Misses 44630 44638 +8
- Partials 640 641 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
str.to_integer
panics for certain inputs
Can someone review this? |
I’ve made some minor adjustments; everything is ready now. |
Description
This PR addresses an issue #22242 where calling str.to_integer() with strict=True unexpectedly panics for certain inputs.
The problem occurs because the values s and base at line 118 do not always correspond correctly, which leads to the bug. This PR modifies how some_failures is retrieved in original order so that s and base are properly paired, preventing the panic.
polars/crates/polars-ops/src/chunked_array/strings/namespace.rs
Lines 95 to 124 in 69ad1ba
close #22242