@@ -2085,12 +2085,14 @@ def test_datetime_timedelta_first_last(engine, func) -> None:
2085
2085
2086
2086
@requires_dask
2087
2087
@requires_sparse
2088
- def test_reindex_sparse ():
2088
+ @pytest .mark .xdist_group (name = "sparse-group" )
2089
+ @pytest .mark .parametrize ("size" , [2 ** 62 - 1 , 11 ])
2090
+ def test_reindex_sparse (size ):
2089
2091
import sparse
2090
2092
2091
2093
array = dask .array .ones ((2 , 12 ), chunks = (- 1 , 3 ))
2092
2094
func = "sum"
2093
- expected_groups = pd .Index ( np . arange ( 11 ) )
2095
+ expected_groups = pd .RangeIndex ( size )
2094
2096
by = dask .array .from_array (np .repeat (np .arange (6 ) * 2 , 2 ), chunks = (3 ,))
2095
2097
dense = np .zeros ((2 , 11 ))
2096
2098
dense [..., np .arange (6 ) * 2 ] = 2
@@ -2115,9 +2117,10 @@ def mocked_reindex(*args, **kwargs):
2115
2117
actual , * _ = groupby_reduce (
2116
2118
array , by , func = func , reindex = reindex , expected_groups = expected_groups , fill_value = 0
2117
2119
)
2118
- assert_equal (actual , expected )
2119
- # once during graph construction, 10 times afterward
2120
- assert mocked_func .call_count > 1
2120
+ if size == 11 :
2121
+ assert_equal (actual , expected )
2122
+ # once during graph construction, 10 times afterward
2123
+ assert mocked_func .call_count > 1
2121
2124
2122
2125
2123
2126
def test_sparse_errors ():
0 commit comments