@pytest.mark.parametrize('engine', ['pandas', pytest.param('cudf', marks=pytest.mark.gpu)])
def test_set_index_interpolate(engine):
    if (engine == 'cudf'):
        cudf = pytest.importorskip('cudf')
        dask_cudf = pytest.importorskip('dask_cudf')
    df = pd.DataFrame({'x': [4, 1, 1, 3, 3], 'y': [1.0, 1, 1, 1, 2]})
    if (engine == 'cudf'):
        gdf = cudf.from_pandas(df)
        d = dask_cudf.from_cudf(gdf, npartitions=3)
    else:
        d = dd.from_pandas(df, 2)
    d1 = d.set_index('x', npartitions=3)
    assert (d1.npartitions == 3)
    assert (set(d1.divisions) == {1, 2, 4})
    d2 = d.set_index('y', npartitions=3)
    assert (d2.divisions[0] == 1.0)
    assert (1.0 < d2.divisions[1] < d2.divisions[2] < 2.0)
    assert (d2.divisions[3] == 2.0)
@pytest.mark.parametrize('engine', ['pandas', pytest.param('cudf', marks=pytest.mark.gpu)])
def test_set_index_interpolate(engine):
    if (engine == 'cudf'):
        cudf = pytest.importorskip('cudf')
        dask_cudf = pytest.importorskip('dask_cudf')
    df = pd.DataFrame({'x': [4, 1, 1, 3, 3], 'y': [1.0, 1, 1, 1, 2]})
    if (engine == 'cudf'):
        gdf = cudf.from_pandas(df)
        d = dask_cudf.from_cudf(gdf, npartitions=3)
    else:
        d = dd.from_pandas(df, 2)
    d1 = d.set_index('x', npartitions=3)
    assert (d1.npartitions == 3)
    assert (set(d1.divisions) == {1, 2, 4})
    d2 = d.set_index('y', npartitions=3)
    assert (d2.divisions[0] == 1.0)
    assert (1.0 < d2.divisions[1] < d2.divisions[2] < 2.0)
    assert (d2.divisions[3] == 2.0)