@@ -1891,10 +1891,10 @@ def resample_as_pandas(array, *args, **kwargs):
1891
1891
1892
1892
rs = array .resample (time = "24h" , closed = "right" )
1893
1893
actual = rs .mean ()
1894
- shuffled = rs .distributed_shuffle ().resample (time = "24h" , closed = "right" ). mean ()
1894
+ shuffled = rs .distributed_shuffle ().resample (time = "24h" , closed = "right" )
1895
1895
expected = resample_as_pandas (array , "24h" , closed = "right" )
1896
1896
assert_identical (expected , actual )
1897
- assert_identical (expected , shuffled )
1897
+ assert_identical (expected , shuffled . mean () )
1898
1898
1899
1899
with pytest .raises (ValueError , match = r"Index must be monotonic" ):
1900
1900
array [[2 , 0 , 1 ]].resample (time = resample_freq )
@@ -2883,9 +2883,10 @@ def test_multiple_groupers(use_flox: bool, shuffle: bool) -> None:
2883
2883
coords = {"xy" : (("x" , "y" ), [["a" , "b" , "c" ], ["b" , "c" , "c" ]], {"foo" : "bar" })},
2884
2884
dims = ["x" , "y" , "z" ],
2885
2885
)
2886
- gb = b .groupby (x = UniqueGrouper (), y = UniqueGrouper ())
2886
+ groupers = dict (x = UniqueGrouper (), y = UniqueGrouper ())
2887
+ gb = b .groupby (groupers )
2887
2888
if shuffle :
2888
- gb = gb .distributed_shuffle ()
2889
+ gb = gb .distributed_shuffle (). groupby ( groupers )
2889
2890
repr (gb )
2890
2891
with xr .set_options (use_flox = use_flox ):
2891
2892
assert_identical (gb .mean ("z" ), b .mean ("z" ))
0 commit comments