Skip to content

Commit 130eeb3

Browse files
committed
Fix more tests
1 parent 18d5e62 commit 130eeb3

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

pandas/tests/frame/test_reductions.py

+12-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import numpy as np
77
import pytest
88

9+
from pandas._config import using_pyarrow_string_dtype
10+
911
from pandas.compat import (
1012
IS64,
1113
is_platform_windows,
@@ -386,6 +388,9 @@ def test_mixed_ops(self, op):
386388
with pytest.raises(TypeError, match=msg):
387389
getattr(df, op)()
388390

391+
@pytest.mark.xfail(
392+
using_pyarrow_string_dtype(), reason="sum doesn't work for arrow strings"
393+
)
389394
def test_reduce_mixed_frame(self):
390395
# GH 6806
391396
df = DataFrame(
@@ -452,7 +457,9 @@ def test_mean_mixed_string_decimal(self):
452457

453458
df = DataFrame(d)
454459

455-
with pytest.raises(TypeError, match="unsupported operand type"):
460+
with pytest.raises(
461+
TypeError, match="unsupported operand type|does not support"
462+
):
456463
df.mean()
457464
result = df[["A", "C"]].mean()
458465
expected = Series([2.7, 681.6], index=["A", "C"], dtype=object)
@@ -584,7 +591,7 @@ def test_mode_dropna(self, dropna, expected):
584591
"A": [12, 12, 19, 11],
585592
"B": [10, 10, np.nan, 3],
586593
"C": [1, np.nan, np.nan, np.nan],
587-
"D": [np.nan, np.nan, "a", np.nan],
594+
"D": Series([np.nan, np.nan, "a", np.nan], dtype=object),
588595
"E": Categorical([np.nan, np.nan, "a", np.nan]),
589596
"F": to_datetime(["NaT", "2000-1-2", "NaT", "NaT"]),
590597
"G": to_timedelta(["1 days", "nan", "nan", "nan"]),
@@ -1868,6 +1875,9 @@ def test_sum_timedelta64_skipna_false(using_array_manager, request):
18681875
tm.assert_series_equal(result, expected)
18691876

18701877

1878+
@pytest.mark.xfail(
1879+
using_pyarrow_string_dtype(), reason="sum doesn't work with arrow strings"
1880+
)
18711881
def test_mixed_frame_with_integer_sum():
18721882
# https://github.com/pandas-dev/pandas/issues/34520
18731883
df = DataFrame([["a", 1]], columns=list("ab"))

0 commit comments

Comments
 (0)