Skip to content
forked from pydata/xarray

Commit 62c334b

Browse files
committed
silence warnings
1 parent b7805a8 commit 62c334b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Diff for: xarray/tests/test_groupby.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -1117,8 +1117,11 @@ def test_groupby_iter(self):
11171117
):
11181118
assert exp_x == act_x
11191119
assert_identical(exp_ds["foo"], act_dv)
1120-
for (_, exp_dv), (_, act_dv) in zip(self.dv.groupby("x"), self.dv.groupby("x")):
1121-
assert_identical(exp_dv, act_dv)
1120+
with pytest.warns(UserWarning, match="The `squeeze` kwarg"):
1121+
for (_, exp_dv), (_, act_dv) in zip(
1122+
self.dv.groupby("x"), self.dv.groupby("x")
1123+
):
1124+
assert_identical(exp_dv, act_dv)
11221125

11231126
def test_groupby_properties(self):
11241127
grouped = self.da.groupby("abc")
@@ -1480,7 +1483,7 @@ def test_groupby_bins(
14801483
df = array.to_dataframe()
14811484
df["dim_0_bins"] = pd.cut(array["dim_0"], bins, **cut_kwargs)
14821485

1483-
expected_df = df.groupby("dim_0_bins").sum()
1486+
expected_df = df.groupby("dim_0_bins", observed=True).sum()
14841487
# TODO: can't convert df with IntervalIndex to Xarray
14851488
expected = (
14861489
expected_df.reset_index(drop=True)

0 commit comments

Comments
 (0)