(nelem, by, ascending)
| 1071 | @pytest.mark.parametrize("by", ["a", "b", ["a", "b"]]) |
| 1072 | @pytest.mark.parametrize("nelem", [10, 500]) |
| 1073 | def 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( |
nothing calls this directly
no test coverage detected