Skip to content

Commit 4cfbc8c

Browse files
Debian Science Teamrebecca-palmer
Debian Science Team
authored andcommitted
Avoid test-failing xarray warning
Author: Luke Manley Origin: upstream pandas-dev/pandas#56949 Bug-Debian: https://bugs.debian.org/1066801 Forwarded: not-needed Gbp-Pq: Name xarray2024_compat.patch
1 parent bb3b356 commit 4cfbc8c

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):
4141
df.index.name = "foo"
4242
df.columns.name = "bar"
4343
result = df.to_xarray()
44-
assert result.dims["foo"] == 3
44+
assert result.sizes["foo"] == 3
4545
assert len(result.coords) == 1
4646
assert len(result.data_vars) == 8
4747
tm.assert_almost_equal(list(result.coords.keys()), ["foo"])
@@ -60,7 +60,7 @@ def test_to_xarray_empty(self, df):
6060

6161
df.index.name = "foo"
6262
result = df[0:0].to_xarray()
63-
assert result.dims["foo"] == 0
63+
assert result.sizes["foo"] == 0
6464
assert isinstance(result, Dataset)
6565

6666
def test_to_xarray_with_multiindex(self, df):
@@ -69,8 +69,8 @@ def test_to_xarray_with_multiindex(self, df):
6969
# MultiIndex
7070
df.index = MultiIndex.from_product([["a"], range(3)], names=["one", "two"])
7171
result = df.to_xarray()
72-
assert result.dims["one"] == 1
73-
assert result.dims["two"] == 3
72+
assert result.sizes["one"] == 1
73+
assert result.sizes["two"] == 3
7474
assert len(result.coords) == 2
7575
assert len(result.data_vars) == 8
7676
tm.assert_almost_equal(list(result.coords.keys()), ["one", "two"])

0 commit comments

Comments
 (0)