def test_set_index_sorts():
    vals = np.array([1348550149000000000, 1348550149000000000, 1348558142000000000, 1348558142000000000, 1348585928000000000, 1348585928000000000, 1348600739000000000, 1348601706000000000, 1348600739000000000, 1348601706000000000, 1348614789000000000, 1348614789000000000, 1348621037000000000, 1348621038000000000, 1348621040000000000, 1348621037000000000, 1348621038000000000, 1348621040000000000, 1348637628000000000, 1348638159000000000, 1348638160000000000, 1348638159000000000, 1348638160000000000, 1348637628000000000, 1348646354000000000, 1348646354000000000, 1348659107000000000, 1348657111000000000, 1348659107000000000, 1348657111000000000, 1348672876000000000, 1348672876000000000, 1348682787000000000, 1348681985000000000, 1348682787000000000, 1348681985000000000, 1348728167000000000, 1348728167000000000, 1348730745000000000, 1348730745000000000, 1348750198000000000, 1348750198000000000, 1348750198000000000, 1348753539000000000, 1348753539000000000, 1348753539000000000, 1348754449000000000, 1348754449000000000, 1348761333000000000, 1348761554000000000, 1348761610000000000, 1348761333000000000, 1348761554000000000, 1348761610000000000, 1348782624000000000, 1348782624000000000, 1348782624000000000, 1348782624000000000])
    vals = pd.to_datetime(vals, unit='ns')
    breaks = [10, 36, 58]
    dfs = []
    for i in range(len(breaks)):
        lo = sum(breaks[:i])
        hi = sum(breaks[i:(i + 1)])
        dfs.append(pd.DataFrame({'timestamp': vals[lo:hi]}, index=range(lo, hi)))
    ddf = dd.concat(dfs).clear_divisions()
    assert (ddf.set_index('timestamp').index.compute().is_monotonic_increasing is True)
def test_set_index_sorts():
    vals = np.array([1348550149000000000, 1348550149000000000, 1348558142000000000, 1348558142000000000, 1348585928000000000, 1348585928000000000, 1348600739000000000, 1348601706000000000, 1348600739000000000, 1348601706000000000, 1348614789000000000, 1348614789000000000, 1348621037000000000, 1348621038000000000, 1348621040000000000, 1348621037000000000, 1348621038000000000, 1348621040000000000, 1348637628000000000, 1348638159000000000, 1348638160000000000, 1348638159000000000, 1348638160000000000, 1348637628000000000, 1348646354000000000, 1348646354000000000, 1348659107000000000, 1348657111000000000, 1348659107000000000, 1348657111000000000, 1348672876000000000, 1348672876000000000, 1348682787000000000, 1348681985000000000, 1348682787000000000, 1348681985000000000, 1348728167000000000, 1348728167000000000, 1348730745000000000, 1348730745000000000, 1348750198000000000, 1348750198000000000, 1348750198000000000, 1348753539000000000, 1348753539000000000, 1348753539000000000, 1348754449000000000, 1348754449000000000, 1348761333000000000, 1348761554000000000, 1348761610000000000, 1348761333000000000, 1348761554000000000, 1348761610000000000, 1348782624000000000, 1348782624000000000, 1348782624000000000, 1348782624000000000])
    vals = pd.to_datetime(vals, unit='ns')
    breaks = [10, 36, 58]
    dfs = []
    for i in range(len(breaks)):
        lo = sum(breaks[:i])
        hi = sum(breaks[i:(i + 1)])
        dfs.append(pd.DataFrame({'timestamp': vals[lo:hi]}, index=range(lo, hi)))
    ddf = dd.concat(dfs).clear_divisions()
    assert (ddf.set_index('timestamp').index.compute().is_monotonic_increasing is True)