From 62c334b05075b6711ce48086da8099e65897a6cd Mon Sep 17 00:00:00 2001 From: Deepak Cherian Date: Fri, 1 Dec 2023 20:45:17 -0700 Subject: [PATCH] silence warnings --- xarray/tests/test_groupby.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/xarray/tests/test_groupby.py b/xarray/tests/test_groupby.py index 97e259988de..6f48b6e11bc 100644 --- a/xarray/tests/test_groupby.py +++ b/xarray/tests/test_groupby.py @@ -1117,8 +1117,11 @@ def test_groupby_iter(self): ): assert exp_x == act_x assert_identical(exp_ds["foo"], act_dv) - for (_, exp_dv), (_, act_dv) in zip(self.dv.groupby("x"), self.dv.groupby("x")): - assert_identical(exp_dv, act_dv) + with pytest.warns(UserWarning, match="The `squeeze` kwarg"): + for (_, exp_dv), (_, act_dv) in zip( + self.dv.groupby("x"), self.dv.groupby("x") + ): + assert_identical(exp_dv, act_dv) def test_groupby_properties(self): grouped = self.da.groupby("abc") @@ -1480,7 +1483,7 @@ def test_groupby_bins( df = array.to_dataframe() df["dim_0_bins"] = pd.cut(array["dim_0"], bins, **cut_kwargs) - expected_df = df.groupby("dim_0_bins").sum() + expected_df = df.groupby("dim_0_bins", observed=True).sum() # TODO: can't convert df with IntervalIndex to Xarray expected = ( expected_df.reset_index(drop=True)