Skip to content

Commit 8c90b35

Browse files
committed
Filling null values with false for boolean arrays only
1 parent 83a8069 commit 8c90b35

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pandas/core/arrays/arrow/array.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -921,8 +921,10 @@ def _evaluate_op_method(self, other, op, arrow_funcs) -> Self:
921921

922922
try:
923923
if HAS_PYARROW:
924-
other = pc.fill_null(other, False)
925-
self._pa_array = pc.fill_null(self._pa_array, False)
924+
if pa.types.is_boolean(self._pa_array.type):
925+
other = pc.fill_null(other, False)
926+
self._pa_array = pc.fill_null(self._pa_array, False)
927+
926928
result = pc_func(self._pa_array, other)
927929
except pa.ArrowNotImplementedError as err:
928930
raise TypeError(self._op_method_error_message(other_original, op)) from err

0 commit comments

Comments
 (0)