BUG/DEPR: logical operation with bool and string#61995
BUG/DEPR: logical operation with bool and string#61995mroeschke merged 1 commit intopandas-dev:mainfrom
Conversation
|
Thanks @jbrockmendel |
|
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon! Remember to remove the If these instructions are inaccurate, feel free to suggest an improvement. |
| f"'{op_name}' operations between boolean dtype and {self.dtype} are " | ||
| "deprecated and will raise in a future version. Explicitly " | ||
| "cast the strings to a boolean dtype before operating instead.", | ||
| FutureWarning, |
There was a problem hiding this comment.
| FutureWarning, | |
| DeprecationWarning, |
jorisvandenbossche
left a comment
There was a problem hiding this comment.
Thanks for looking at this!
| "string" type in the JSON Table Schema for :class:`StringDtype` columns | ||
| (:issue:`61889`) | ||
|
|
||
| - Boolean operations (``|``, ``&``, ``^``) with bool-dtype objects on the left and :class:`StringDtype` objects on the right now cast the string to bool, with a deprecation warning (:issue:`60234`) |
There was a problem hiding this comment.
Your PR might have fixed both, but I don't think this is specific to bool dtype being on the left and string on the right? Both orders of operation fails right now?
There was a problem hiding this comment.
The old behavior that we are trying to match (with object dtype) does depend specifically on the ndarray[bool] being on the left
There was a problem hiding this comment.
Ah, I was only testing with string dtype to check that both were failing. You're right that for object this only worked in that order. Ignore me!
|
|
||
| msg = "operations between boolean dtype and" | ||
| with tm.assert_produces_warning(warn, match=msg): | ||
| result = left | right |
There was a problem hiding this comment.
Related to the other comment, would also test right | left
|
Manual backport -> #62114 |
doc/source/whatsnew/vX.X.X.rstfile if fixing a bug or adding a new feature.