Skip to content

Commit f180bc8

Browse files
committed
Fix broken ArrowStringArray tests
1 parent c5e9f17 commit f180bc8

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

pandas/core/arrays/arrow/array.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,10 @@ def __arrow_array__(self, type=None):
832832
def __array_ufunc__(self, ufunc: np.ufunc, method: str, *inputs, **kwargs):
833833
# Need to wrap np.array results GH#62800
834834
result = super().__array_ufunc__(ufunc, method, *inputs, **kwargs)
835-
return type(self)._from_sequence(result)
835+
if type(self) is ArrowExtensionArray:
836+
# Exclude ArrowStringArray
837+
return type(self)._from_sequence(result)
838+
return result
836839

837840
def __array__(
838841
self, dtype: NpDtype | None = None, copy: bool | None = None

pandas/tests/series/test_npfuncs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def test_log_arrow_backed_missing_value(using_nan_is_na):
4343
ser = Series([1, 2, None], dtype="float64[pyarrow]")
4444
if using_nan_is_na:
4545
result = np.log(ser)
46-
expected = np.log(Series([1, 2, None], dtype="float64"))
46+
expected = np.log(Series([1, 2, None], dtype="float64[pyarrow]"))
4747
tm.assert_series_equal(result, expected)
4848
else:
4949
# we get cast to object which raises

0 commit comments

Comments
 (0)