def test_set_index_empty_partition():
    test_vals = [1, 2, 3]
    converters = [int, float, str, (lambda x: pd.to_datetime(x, unit='ns'))]
    for conv in converters:
        df = pd.DataFrame([{'x': conv(i), 'y': i} for i in test_vals], columns=['x', 'y'])
        ddf = dd.concat([dd.from_pandas(df, npartitions=1), dd.from_pandas(df[(df.y > df.y.max())], npartitions=1)])
        assert any((ddf.get_partition(p).compute().empty for p in range(ddf.npartitions)))
        assert assert_eq(ddf.set_index('x'), df.set_index('x'))
def test_set_index_empty_partition():
    test_vals = [1, 2, 3]
    converters = [int, float, str, (lambda x: pd.to_datetime(x, unit='ns'))]
    for conv in converters:
        df = pd.DataFrame([{'x': conv(i), 'y': i} for i in test_vals], columns=['x', 'y'])
        ddf = dd.concat([dd.from_pandas(df, npartitions=1), dd.from_pandas(df[(df.y > df.y.max())], npartitions=1)])
        assert any((ddf.get_partition(p).compute().empty for p in range(ddf.npartitions)))
        assert assert_eq(ddf.set_index('x'), df.set_index('x'))