Skip to content

TST: Seemingly non-deterministic order of value_counts #32514

Closed
@SaturnFromTitan

Description

@SaturnFromTitan

We had a flaky test for test_value_counts in pandas/tests/base/test_ops.py which was related to the sort order of entries with the same count. A hotfix was introduced in #32449 and resolves the CI issue.

The underlying issue still isn't fixed/confirmed. The test assumes that in case of same counts the order of the original index/series object is preserved. This assumption breaks on CI though. Please refer to my comment (and the following ones) for all related details I have found so far.

It doesn't necessarily seem to be related to the narrow dtypes. It's probably just more likely that values are duplicated the narrower the dtype is.

Metadata

Metadata

Labels

AlgosNon-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diffBugTestingpandas testing functions or related to the test suite

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions