-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
BUG: Fix Index.putmask makes stack overflow with an invalid mask #18407
BUG: Fix Index.putmask makes stack overflow with an invalid mask #18407
Conversation
Codecov Report
@@ Coverage Diff @@
## master #18407 +/- ##
==========================================
- Coverage 91.33% 91.29% -0.05%
==========================================
Files 163 163
Lines 49752 49754 +2
==========================================
- Hits 45443 45424 -19
- Misses 4309 4330 +21
Continue to review full report at Codecov.
|
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.
pls add a whatsnew note (0.21.1 is ok)
pandas/core/indexes/base.py
Outdated
# coerces to object | ||
return self.astype(object).putmask(mask, value) | ||
except (ValueError, TypeError) as err: | ||
if self.dtype == np.dtype(object): |
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.
can you use is_object_dtype
pandas/core/indexes/base.py
Outdated
except (ValueError, TypeError) as err: | ||
if self.dtype == np.dtype(object): | ||
raise err | ||
else: |
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.
just use the return here, no else is needed
683dab7
to
0b71ffe
Compare
@jreback Thanks! Fixed! |
lgtm. ping on green. |
thanks @Licht-T keep em coming! |
…das-dev#18407) (cherry picked from commit b69c1a2)
) (cherry picked from commit b69c1a2)
git diff upstream/master -u -- "*.py" | flake8 --diff