Skip to content

Commit 3d9e157

Browse files
committed
BUG: PeriodIndex fails to handle NA, rather than putting NaT in its place (pandas-dev#46673)
1 parent f2c6723 commit 3d9e157

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pandas/tests/extension/test_arrow.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1479,7 +1479,7 @@ def test_combine_le(self, data_repeated):
14791479

14801480
def test_combine_add(self, data_repeated, request):
14811481
pa_dtype = next(data_repeated(1)).dtype.pyarrow_dtype
1482-
if pa.types.is_temporal(pa_dtype) and pa_dtype != 'duration[ns]':
1482+
if pa.types.is_temporal(pa_dtype) and pa_dtype != "duration[ns]":
14831483
request.node.add_marker(
14841484
pytest.mark.xfail(
14851485
raises=TypeError,
@@ -1552,7 +1552,7 @@ def test_arith_series_with_scalar(
15521552
all_arithmetic_operators in ("__add__", "__radd__")
15531553
and pa.types.is_duration(pa_dtype)
15541554
or all_arithmetic_operators in ("__sub__", "__rsub__")
1555-
and pa.types.is_temporal(pa_dtype) and pa_dtype != 'duration[ns]'
1555+
and pa.types.is_temporal(pa_dtype)
15561556
)
15571557
if (
15581558
all_arithmetic_operators
@@ -1589,7 +1589,7 @@ def test_arith_series_with_scalar(
15891589
elif arrow_temporal_supported:
15901590
request.node.add_marker(
15911591
pytest.mark.xfail(
1592-
raises=TypeError,
1592+
raises=TypeError if pa_dtype != "duration[ns]" else AssertionError,
15931593
reason=(
15941594
f"{all_arithmetic_operators} not supported between"
15951595
f"pd.NA and {pa_dtype} Python scalar"
@@ -1655,7 +1655,7 @@ def test_arith_frame_with_scalar(
16551655
elif arrow_temporal_supported:
16561656
request.node.add_marker(
16571657
pytest.mark.xfail(
1658-
raises=TypeError,
1658+
raises=TypeError if pa_dtype != "duration[ns]" else AssertionError,
16591659
reason=(
16601660
f"{all_arithmetic_operators} not supported between"
16611661
f"pd.NA and {pa_dtype} Python scalar"
@@ -1739,7 +1739,7 @@ def test_arith_series_with_array(
17391739
elif arrow_temporal_supported:
17401740
request.node.add_marker(
17411741
pytest.mark.xfail(
1742-
raises=TypeError,
1742+
raises=TypeError if pa_dtype != "duration[ns]" else AssertionError,
17431743
reason=(
17441744
f"{all_arithmetic_operators} not supported between"
17451745
f"pd.NA and {pa_dtype} Python scalar"

0 commit comments

Comments
 (0)