Skip to content

Commit

Permalink
Fix sort_values pytest failure with pandas-2.x regression (#15092)
Browse files Browse the repository at this point in the history
pandas-2.x seems to have introduced an ordering regression where the index order is not preserved for cases when there is a tie.

Authors:
  - GALI PREM SAGAR (https://github.com/galipremsagar)

Approvers:
  - Matthew Roeschke (https://github.com/mroeschke)

URL: #15092
  • Loading branch information
galipremsagar authored Feb 20, 2024
1 parent 6903f80 commit e7a7e48
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions python/cudf/cudf/tests/test_sorting.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,13 @@ def test_dataframe_sort_values(nelem, dtype):

@pytest.mark.parametrize("ignore_index", [True, False])
@pytest.mark.parametrize("index", ["a", "b", ["a", "b"]])
def test_dataframe_sort_values_ignore_index(index, ignore_index):
if not PANDAS_GE_220 and isinstance(index, list) and not ignore_index:
pytest.skip(
reason="TODO: Remove this once pandas-2.2 support is added",
def test_dataframe_sort_values_ignore_index(request, index, ignore_index):
request.applymarker(
pytest.mark.xfail(
PANDAS_GE_220 and isinstance(index, list) and not ignore_index,
reason="https://github.com/pandas-dev/pandas/issues/57531",
)
)

gdf = DataFrame(
{"a": [1, 3, 5, 2, 4], "b": [1, 1, 2, 2, 3], "c": [9, 7, 7, 7, 1]}
Expand Down

0 comments on commit e7a7e48

Please sign in to comment.