Skip to content

Commit d005195

Browse files
committed
TST(str dtype): Resolve xfail for unary +
1 parent 57d2489 commit d005195

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

pandas/core/arrays/string_arrow.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import re
55
from typing import (
66
TYPE_CHECKING,
7+
Never,
78
Union,
89
)
910
import warnings
@@ -481,6 +482,9 @@ def _cmp_method(self, other, op):
481482
return result.to_numpy(np.bool_, na_value=False)
482483
return result
483484

485+
def __pos__(self) -> Never:
486+
raise TypeError(f"bad operand type for unary +: '{self.dtype}'")
487+
484488

485489
class ArrowStringArrayNumpySemantics(ArrowStringArray):
486490
_na_value = np.nan

pandas/tests/frame/test_unary.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
import numpy as np
44
import pytest
55

6-
from pandas._config import using_string_dtype
7-
8-
from pandas.compat import HAS_PYARROW
96
from pandas.compat.numpy import np_version_gte1p25
107

118
import pandas as pd
@@ -122,9 +119,6 @@ def test_pos_object(self, df_data):
122119
tm.assert_frame_equal(+df, df)
123120
tm.assert_series_equal(+df["a"], df["a"])
124121

125-
@pytest.mark.xfail(
126-
using_string_dtype() and HAS_PYARROW, reason="TODO(infer_string)"
127-
)
128122
@pytest.mark.filterwarnings("ignore:Applying:DeprecationWarning")
129123
def test_pos_object_raises(self):
130124
# GH#21380

0 commit comments

Comments
 (0)