(backend, by, ascending)
| 1090 | @pytest.mark.parametrize("by", ["x", "z", ["x", "z"], ["z", "x"]]) |
| 1091 | @pytest.mark.parametrize("ascending", [True, False]) |
| 1092 | def test_sort_values_tasks_backend(backend, by, ascending): |
| 1093 | if backend == "cudf": |
| 1094 | pytest.importorskip("dask_cudf") |
| 1095 | pdf = pd.DataFrame( |
| 1096 | {"x": range(10), "y": [1, 2, 3, 4, 5] * 2, "z": ["cat", "dog"] * 5} |
| 1097 | ) |
| 1098 | ddf = dd.from_pandas(pdf, npartitions=10) |
| 1099 | if backend == "cudf": |
| 1100 | ddf = ddf.to_backend(backend) |
| 1101 | |
| 1102 | expect = pdf.sort_values(by=by, ascending=ascending) |
| 1103 | got = dd.DataFrame.sort_values( |
| 1104 | ddf, by=by, ascending=ascending, shuffle_method="tasks" |
| 1105 | ) |
| 1106 | dd.assert_eq(got, expect, sort_results=False) |
| 1107 | |
| 1108 | |
| 1109 | @pytest.mark.parametrize("ascending", [True, False, [False, True], [True, False]]) |
nothing calls this directly
no test coverage detected