-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
fix(rust,python): Harden Series.reshape
against invalid parameters
#16281
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #16281 +/- ##
==========================================
+ Coverage 80.80% 80.81% +0.01%
==========================================
Files 1393 1393
Lines 179406 179406
Branches 2921 2921
==========================================
+ Hits 144971 144989 +18
+ Misses 33932 33914 -18
Partials 503 503 ☔ View full report in Codecov by Sentry. |
While
We could explode
|
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.
Thank you @datenzauberai
This is a fix for #15543
Improvements:
dimensions < -1
will raise an error instead of panicking-1
whenever it is possible;(-1, -1)
will be inferred to either(0, 0)
for an empty series or to(len(), 1)
for a non-empty series(0, 0)
or(0, )
(after inferring)rows*cols == len()
after inferring placeholders will raise an error