Skip to content

Commit 83a8069

Browse files
committed
Conditional Null filling by checking if pyarrow is availble or now
1 parent 1d53ce7 commit 83a8069

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pandas/core/arrays/arrow/array.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import warnings
1818

1919
import numpy as np
20-
import pyarrow.compute as pc
2120

2221
from pandas._libs import lib
2322
from pandas._libs.tslibs import (
@@ -921,8 +920,9 @@ def _evaluate_op_method(self, other, op, arrow_funcs) -> Self:
921920
raise NotImplementedError(f"{op.__name__} not implemented.")
922921

923922
try:
924-
other = pc.fill_null(other, False)
925-
self._pa_array = pc.fill_null(self._pa_array, False)
923+
if HAS_PYARROW:
924+
other = pc.fill_null(other, False)
925+
self._pa_array = pc.fill_null(self._pa_array, False)
926926
result = pc_func(self._pa_array, other)
927927
except pa.ArrowNotImplementedError as err:
928928
raise TypeError(self._op_method_error_message(other_original, op)) from err

0 commit comments

Comments
 (0)