(df, pdf, shuffle)
| 345 | |
| 346 | @pytest.mark.parametrize("shuffle", [None, "tasks"]) |
| 347 | def test_sort_values(df, pdf, shuffle): |
| 348 | assert_eq(df.sort_values("x", shuffle_method=shuffle), pdf.sort_values("x")) |
| 349 | assert_eq( |
| 350 | df.sort_values("x", shuffle_method=shuffle, npartitions=2), pdf.sort_values("x") |
| 351 | ) |
| 352 | pdf.iloc[5, 0] = -10 |
| 353 | df = from_pandas(pdf, npartitions=10) |
| 354 | assert_eq( |
| 355 | df.sort_values("x", shuffle_method=shuffle, upsample=2.0), pdf.sort_values("x") |
| 356 | ) |
| 357 | |
| 358 | assert_eq( |
| 359 | df.sort_values(by=["x", "y"], shuffle_method=shuffle, ascending=[True, True]), |
| 360 | pdf.sort_values(by=["x", "y"], ascending=[True, True]), |
| 361 | ) |
| 362 | with pytest.raises(NotImplementedError, match="sorting by named columns"): |
| 363 | df.sort_values(by=1, shuffle_method=shuffle) |
| 364 | |
| 365 | with pytest.raises(ValueError, match="must be either 'first' or 'last'"): |
| 366 | df.sort_values(by="x", shuffle_method=shuffle, na_position="bla") |
| 367 | |
| 368 | |
| 369 | @pytest.mark.parametrize("shuffle", [None, "tasks"]) |
nothing calls this directly
no test coverage detected