diff --git a/pandas/tests/indexes/test_common.py b/pandas/tests/indexes/test_common.py index d8e17e48a19b3..23677d77a5273 100644 --- a/pandas/tests/indexes/test_common.py +++ b/pandas/tests/indexes/test_common.py @@ -448,8 +448,15 @@ def test_hasnans_isnans(self, index_flat): @pytest.mark.parametrize("na_position", [None, "middle"]) def test_sort_values_invalid_na_position(index_with_missing, na_position): + dtype = index_with_missing.dtype + warning = ( + PerformanceWarning + if dtype.name == "string" and dtype.storage == "pyarrow" + else None + ) with pytest.raises(ValueError, match=f"invalid na_position: {na_position}"): - index_with_missing.sort_values(na_position=na_position) + with tm.assert_produces_warning(warning): + index_with_missing.sort_values(na_position=na_position) @pytest.mark.parametrize("na_position", ["first", "last"])