def test_set_index_divisions_2():
    df = pd.DataFrame({'x': [1, 2, 3, 4, 5, 6], 'y': list('abdabd')})
    ddf = dd.from_pandas(df, 2)
    result = ddf.set_index('y', divisions=['a', 'c', 'd'])
    assert (result.divisions == ('a', 'c', 'd'))
    assert (list(result.compute(scheduler='sync').index[(- 2):]) == ['d', 'd'])
def test_set_index_divisions_2():
    df = pd.DataFrame({'x': [1, 2, 3, 4, 5, 6], 'y': list('abdabd')})
    ddf = dd.from_pandas(df, 2)
    result = ddf.set_index('y', divisions=['a', 'c', 'd'])
    assert (result.divisions == ('a', 'c', 'd'))
    assert (list(result.compute(scheduler='sync').index[(- 2):]) == ['d', 'd'])