Skip to content

Commit

Permalink
silence warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
dcherian committed Dec 2, 2023
1 parent b7805a8 commit 62c334b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions xarray/tests/test_groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 62c334b

Please sign in to comment.