|
6 | 6 | import numpy as np
|
7 | 7 | import pytest
|
8 | 8 |
|
| 9 | +from pandas._config import using_pyarrow_string_dtype |
| 10 | + |
9 | 11 | from pandas.compat import (
|
10 | 12 | IS64,
|
11 | 13 | is_platform_windows,
|
@@ -386,6 +388,9 @@ def test_mixed_ops(self, op):
|
386 | 388 | with pytest.raises(TypeError, match=msg):
|
387 | 389 | getattr(df, op)()
|
388 | 390 |
|
| 391 | + @pytest.mark.xfail( |
| 392 | + using_pyarrow_string_dtype(), reason="sum doesn't work for arrow strings" |
| 393 | + ) |
389 | 394 | def test_reduce_mixed_frame(self):
|
390 | 395 | # GH 6806
|
391 | 396 | df = DataFrame(
|
@@ -452,7 +457,9 @@ def test_mean_mixed_string_decimal(self):
|
452 | 457 |
|
453 | 458 | df = DataFrame(d)
|
454 | 459 |
|
455 |
| - with pytest.raises(TypeError, match="unsupported operand type"): |
| 460 | + with pytest.raises( |
| 461 | + TypeError, match="unsupported operand type|does not support" |
| 462 | + ): |
456 | 463 | df.mean()
|
457 | 464 | result = df[["A", "C"]].mean()
|
458 | 465 | expected = Series([2.7, 681.6], index=["A", "C"], dtype=object)
|
@@ -584,7 +591,7 @@ def test_mode_dropna(self, dropna, expected):
|
584 | 591 | "A": [12, 12, 19, 11],
|
585 | 592 | "B": [10, 10, np.nan, 3],
|
586 | 593 | "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), |
588 | 595 | "E": Categorical([np.nan, np.nan, "a", np.nan]),
|
589 | 596 | "F": to_datetime(["NaT", "2000-1-2", "NaT", "NaT"]),
|
590 | 597 | "G": to_timedelta(["1 days", "nan", "nan", "nan"]),
|
@@ -1868,6 +1875,9 @@ def test_sum_timedelta64_skipna_false(using_array_manager, request):
|
1868 | 1875 | tm.assert_series_equal(result, expected)
|
1869 | 1876 |
|
1870 | 1877 |
|
| 1878 | +@pytest.mark.xfail( |
| 1879 | + using_pyarrow_string_dtype(), reason="sum doesn't work with arrow strings" |
| 1880 | +) |
1871 | 1881 | def test_mixed_frame_with_integer_sum():
|
1872 | 1882 | # https://github.com/pandas-dev/pandas/issues/34520
|
1873 | 1883 | df = DataFrame([["a", 1]], columns=list("ab"))
|
|
0 commit comments