Skip to content

Commit 12b1d00

Browse files
committed
Fix xarray failures post xarray unpin
1 parent ecf3133 commit 12b1d00

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

pandas/tests/generic/test_to_xarray.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
DataFrame,
77
MultiIndex,
88
Series,
9+
StringDtype,
910
date_range,
1011
)
1112
import pandas._testing as tm
@@ -51,9 +52,6 @@ def test_to_xarray_index_types(self, index_flat, df, using_infer_string):
5152
# datetimes w/tz are preserved
5253
# column names are lost
5354
expected = df.copy()
54-
expected["f"] = expected["f"].astype(
55-
object if not using_infer_string else "str"
56-
)
5755
expected.columns.name = None
5856
tm.assert_frame_equal(result.to_dataframe(), expected)
5957

@@ -88,8 +86,15 @@ def test_to_xarray_with_multiindex(self, df, using_infer_string):
8886

8987

9088
class TestSeriesToXArray:
91-
def test_to_xarray_index_types(self, index_flat):
89+
def test_to_xarray_index_types(self, index_flat, request):
9290
index = index_flat
91+
if isinstance(index.dtype, StringDtype) and index.dtype.storage == "pyarrow":
92+
request.applymarker(
93+
pytest.mark.xfail(
94+
reason="xarray calling reshape of ArrowExtensionArray",
95+
raises=NotImplementedError,
96+
)
97+
)
9398
# MultiIndex is tested in test_to_xarray_with_multiindex
9499

95100
from xarray import DataArray

0 commit comments

Comments
 (0)