@@ -613,6 +613,33 @@ def test_dask_reduce_axis_subset():
613
613
)
614
614
615
615
616
+ @pytest .mark .parametrize (
617
+ "func" ,
618
+ [
619
+ # "first", "last",
620
+ "nanfirst" ,
621
+ "nanlast" ,
622
+ ],
623
+ )
624
+ @pytest .mark .parametrize (
625
+ "chunks" ,
626
+ [
627
+ None ,
628
+ pytest .param (1 , marks = pytest .mark .skipif (not has_dask , reason = "no dask" )),
629
+ pytest .param (2 , marks = pytest .mark .skipif (not has_dask , reason = "no dask" )),
630
+ pytest .param (3 , marks = pytest .mark .skipif (not has_dask , reason = "no dask" )),
631
+ ],
632
+ )
633
+ def test_first_last_useless (func , chunks ):
634
+ array = np .array ([[0 , 0 , 0 ], [0 , 0 , 0 ]], dtype = np .int8 )
635
+ group_idx = np .array ([1 , 0 , 0 ])
636
+ if chunks is not None :
637
+ array = dask .array .from_array (array , chunks = chunks )
638
+ actual , _ = groupby_reduce (array , group_idx , func = func , engine = "numpy" )
639
+ expected = np .array ([[0 , 0 ], [0 , 0 ]], dtype = np .int8 )
640
+ assert_equal (actual , expected )
641
+
642
+
616
643
@pytest .mark .parametrize ("func" , ["first" , "last" , "nanfirst" , "nanlast" ])
617
644
@pytest .mark .parametrize ("axis" , [(0 , 1 )])
618
645
def test_first_last_disallowed (axis , func ):
0 commit comments