Stable sort in Series.value_counts for pandas 3.x#12191
Stable sort in Series.value_counts for pandas 3.x#12191TomAugspurger merged 2 commits intodask:mainfrom
Conversation
pandas 3.x changed the behavior of Series.value_counts to use a stable sort. This changes our value counts aggregation, which uses Series.sort_values, to also use a stable sort, so that we match pandas when `sort=True`. xref dask#12178 (comment)
|
I wasn't able to reproduce this locally, so hopefully CI will tell us whether or not this is fixed. |
Unit Test ResultsSee test report for an extended history of previous test failures. This is useful for diagnosing flaky tests. 9 files + 2 9 suites +2 3h 16m 35s ⏱️ + 45m 12s Results for commit 6e73a96. ± Comparison against base commit 2497ebe. ♻️ This comment has been updated with latest results. |
|
Mmm I'm not too sure about the I couldn't quickly reproduce them, but I haven't attempted to reproduce the environment exactly. The good news is that the test passed on the pandas-nightly job: https://github.com/dask/dask/actions/runs/20104462644/job/57684176833?pr=12191#step:11:22183 |
|
I used the same conda environment on a linux machine and was still unable to reproduce this... If CI fails again I'm tempted to skip these tests on the failing platform. |
|
Weird, it passed this time... I plan to merge this sometime tomorrow. |
pandas 3.x changed the behavior of Series.value_counts to use a stable sort. This changes our value counts aggregation, which uses Series.sort_values, to also use a stable sort, so that we match pandas when
sort=True.xref #12178 (comment)