Skip to content

Commit 32f8932

Browse files
authored
CI: avoid FutureWarnings in to_xarray tests (#56949)
avoid FutureWarnings in to_xarray tests
1 parent 1cc7e19 commit 32f8932

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pandas/tests/generic/test_to_xarray.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def test_to_xarray_index_types(self, index_flat, df, using_infer_string):
4141
df.index.name = "foo"
4242
df.columns.name = "bar"
4343
result = df.to_xarray()
44-
assert result.dims["foo"] == 4
44+
assert result.sizes["foo"] == 4
4545
assert len(result.coords) == 1
4646
assert len(result.data_vars) == 8
4747
tm.assert_almost_equal(list(result.coords.keys()), ["foo"])
@@ -62,7 +62,7 @@ def test_to_xarray_empty(self, df):
6262

6363
df.index.name = "foo"
6464
result = df[0:0].to_xarray()
65-
assert result.dims["foo"] == 0
65+
assert result.sizes["foo"] == 0
6666
assert isinstance(result, Dataset)
6767

6868
def test_to_xarray_with_multiindex(self, df, using_infer_string):
@@ -71,8 +71,8 @@ def test_to_xarray_with_multiindex(self, df, using_infer_string):
7171
# MultiIndex
7272
df.index = MultiIndex.from_product([["a"], range(4)], names=["one", "two"])
7373
result = df.to_xarray()
74-
assert result.dims["one"] == 1
75-
assert result.dims["two"] == 4
74+
assert result.sizes["one"] == 1
75+
assert result.sizes["two"] == 4
7676
assert len(result.coords) == 2
7777
assert len(result.data_vars) == 8
7878
tm.assert_almost_equal(list(result.coords.keys()), ["one", "two"])

0 commit comments

Comments
 (0)