Commit d9fcad7
committed
BUG: Make Series flex methods (truediv, floordiv, etc.) raise NotImplementedError for bool dtypes
This change ensures that flex methods like .truediv(), .rtruediv(), .floordiv(),
.rfloordiv(), .pow(), .rpow() raise NotImplementedError for boolean dtypes,
consistent with their dunder method counterparts (__truediv__, etc.).
Previously, pd.Series([True]).truediv([True]) would return a float result,
while pd.Series([True]) / [True] would raise NotImplementedError. This fixes
the inconsistency by routing _binop through ops.arithmetic_op which includes
the bool dtype check.
Closes #632501 parent 944c527 commit d9fcad7
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6718 | 6718 | | |
6719 | 6719 | | |
6720 | 6720 | | |
6721 | | - | |
| 6721 | + | |
6722 | 6722 | | |
6723 | 6723 | | |
6724 | 6724 | | |
| |||
0 commit comments