-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
DEPR: Series logical ops with different index coercing to bool #52839
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
I for sure prefer this behavior, but its definitely intentional so not sure we can call it a bugfix. The approach i've been kicking around (with little success) for non-aligned cases is to do a .align(join="inner") before operating, kind of like how we do _arith_method_with_reindex Update: also could just deprecate automatic alignment for logical ops |
Fair point. I went ahead and deprecated this behavior instead |
"to maintain the prior behavior.", | ||
FutureWarning, | ||
stacklevel=find_stack_level(), | ||
) |
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.
FWIW i think we should deprecate this casting in all cases
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.
Agreed, I just wanted to issue to warning though were the result type would change i.e. is a user is doing logical ops on booleans they should already get a boolean result hence no need to warn
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.
so do we need to do a second deprecation to handle more cases or when this deprecation is enforced will we be able to remove the entire align_asobject block?
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.
I think we'll be able to remove the entire align_asobject
block once this is enforced. The added if
statement is just warning in the cases where the result type will change in the future
Going to merge, but can address any followups |
…s-dev#52839) * BUG: Series logical ops with different index coercing to bool * Turn into a deprecation * Fix condition * Make futurewarning more specific
…s-dev#52839) * BUG: Series logical ops with different index coercing to bool * Turn into a deprecation * Fix condition * Make futurewarning more specific
…s-dev#52839) * BUG: Series logical ops with different index coercing to bool * Turn into a deprecation * Fix condition * Make futurewarning more specific
bitwise
ufunc operations are being casted tobool
inpandas-2.0
#52500 (Replace xxxx with the GitHub issue number)doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.