Skip to content

Commit a19620e

Browse files
Backport PR #51573 on branch 2.0.x (CI: Fix failure due to warning) (#51586)
Backport PR #51573: CI: Fix failure due to warning Co-authored-by: Patrick Hoefler <[email protected]>
1 parent 679ba77 commit a19620e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pandas/tests/indexes/test_common.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -448,8 +448,15 @@ def test_hasnans_isnans(self, index_flat):
448448

449449
@pytest.mark.parametrize("na_position", [None, "middle"])
450450
def test_sort_values_invalid_na_position(index_with_missing, na_position):
451+
dtype = index_with_missing.dtype
452+
warning = (
453+
PerformanceWarning
454+
if dtype.name == "string" and dtype.storage == "pyarrow"
455+
else None
456+
)
451457
with pytest.raises(ValueError, match=f"invalid na_position: {na_position}"):
452-
index_with_missing.sort_values(na_position=na_position)
458+
with tm.assert_produces_warning(warning):
459+
index_with_missing.sort_values(na_position=na_position)
453460

454461

455462
@pytest.mark.parametrize("na_position", ["first", "last"])

0 commit comments

Comments
 (0)