()
| 163 | |
| 164 | @requires_pandas_ge_2_2 |
| 165 | def test_multi_index_propagation() -> None: |
| 166 | # regression test for GH9648 |
| 167 | times = pd.date_range("2023-01-01", periods=4) |
| 168 | locations = ["A", "B"] |
| 169 | data = [[0.5, 0.7], [0.6, 0.5], [0.4, 0.6], [0.4, 0.9]] |
| 170 | |
| 171 | da = xr.DataArray( |
| 172 | data, dims=["time", "location"], coords={"time": times, "location": locations} |
| 173 | ) |
| 174 | da = da.stack(multiindex=["time", "location"]) |
| 175 | grouped = da.groupby("multiindex") |
| 176 | |
| 177 | with xr.set_options(use_flox=True): |
| 178 | actual = grouped.sum() |
| 179 | with xr.set_options(use_flox=False): |
| 180 | expected = grouped.first() |
| 181 | assert_identical(actual, expected) |
| 182 | |
| 183 | |
| 184 | def test_groupby_da_datetime() -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…