def test_partitioning_index():
    res = partitioning_index(df2.i32, 3)
    assert ((res < 3) & (res >= 0)).all()
    assert (len(np.unique(res)) > 1)
    assert (partitioning_index(df2.i32, 3) == partitioning_index(df2.i32, 3)).all()
    res = partitioning_index(df2[['i32']], 3)
    assert ((res < 3) & (res >= 0)).all()
    assert (len(np.unique(res)) > 1)
    res = partitioning_index(df2[['cat', 'bool', 'f32']], 2)
    assert ((0 <= res) & (res < 2)).all()
    res = partitioning_index(df2.index, 4)
    assert ((res < 4) & (res >= 0)).all()
    assert (len(np.unique(res)) > 1)
def test_partitioning_index():
    res = partitioning_index(df2.i32, 3)
    assert ((res < 3) & (res >= 0)).all()
    assert (len(np.unique(res)) > 1)
    assert (partitioning_index(df2.i32, 3) == partitioning_index(df2.i32, 3)).all()
    res = partitioning_index(df2[['i32']], 3)
    assert ((res < 3) & (res >= 0)).all()
    assert (len(np.unique(res)) > 1)
    res = partitioning_index(df2[['cat', 'bool', 'f32']], 2)
    assert ((0 <= res) & (res < 2)).all()
    res = partitioning_index(df2.index, 4)
    assert ((res < 4) & (res >= 0)).all()
    assert (len(np.unique(res)) > 1)