Skip to content

Commit 9777e84

Browse files
jbrockmendelTomAugspurger
authored andcommitted
REF: use dispatch_to_extension_op for bool ops (#28260)
re-implement #27959, which was previously merged and reverted.
1 parent afe0cc3 commit 9777e84

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pandas/core/ops/__init__.py

+7
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,13 @@ def wrapper(self, other):
829829
# Defer to DataFrame implementation; fail early
830830
return NotImplemented
831831

832+
elif should_extension_dispatch(self, other):
833+
lvalues = extract_array(self, extract_numpy=True)
834+
rvalues = extract_array(other, extract_numpy=True)
835+
res_values = dispatch_to_extension_op(op, lvalues, rvalues)
836+
result = self._constructor(res_values, index=self.index, name=res_name)
837+
return finalizer(result)
838+
832839
elif isinstance(other, (ABCSeries, ABCIndexClass)):
833840
is_other_int_dtype = is_integer_dtype(other.dtype)
834841
other = other if is_other_int_dtype else fill_bool(other)

0 commit comments

Comments
 (0)