MCPcopy Create free account
hub / github.com/dask/dask / test_sort_values

Function test_sort_values

dask/dataframe/tests/test_shuffle.py:1073–1084  ·  view source on GitHub ↗
(nelem, by, ascending)

Source from the content-addressed store, hash-verified

1071@pytest.mark.parametrize("by", ["a", "b", ["a", "b"]])
1072@pytest.mark.parametrize("nelem", [10, 500])
1073def test_sort_values(nelem, by, ascending):
1074 np.random.seed(0)
1075 df = pd.DataFrame()
1076 df["a"] = np.ascontiguousarray(np.arange(nelem)[::-1])
1077 df["b"] = np.arange(100, nelem + 100)
1078 ddf = dd.from_pandas(df, npartitions=10)
1079
1080 # run on single-threaded scheduler for debugging purposes
1081 with dask.config.set(scheduler="single-threaded"):
1082 got = ddf.sort_values(by=by, ascending=ascending)
1083 expect = df.sort_values(by=by, ascending=ascending)
1084 dd.assert_eq(got, expect, check_index=False, sort_results=False)
1085
1086
1087@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 4

sort_valuesMethod · 0.95
setMethod · 0.80
seedMethod · 0.45
arangeMethod · 0.45

Tested by

no test coverage detected