def test_empty_partitions():
    df = pd.DataFrame({'a': list(range(10))})
    df['b'] = (df['a'] % 3)
    df['c'] = df['b'].astype(str)
    ddf = dd.from_pandas(df, npartitions=3)
    ddf = ddf.set_index('b')
    ddf = ddf.repartition(npartitions=3)
    ddf.get_partition(0).compute()
    assert_eq(ddf, df.set_index('b'))
    ddf = ddf.set_index('c')
    assert_eq(ddf, df.set_index('b').set_index('c'))
def test_empty_partitions():
    df = pd.DataFrame({'a': list(range(10))})
    df['b'] = (df['a'] % 3)
    df['c'] = df['b'].astype(str)
    ddf = dd.from_pandas(df, npartitions=3)
    ddf = ddf.set_index('b')
    ddf = ddf.repartition(npartitions=3)
    ddf.get_partition(0).compute()
    assert_eq(ddf, df.set_index('b'))
    ddf = ddf.set_index('c')
    assert_eq(ddf, df.set_index('b').set_index('c'))