File tree Expand file tree Collapse file tree 4 files changed +12
-8
lines changed Expand file tree Collapse file tree 4 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -6227,7 +6227,7 @@ def f(vals) -> tuple[np.ndarray, int]:
6227
6227
# ----------------------------------------------------------------------
6228
6228
# Sorting
6229
6229
# TODO: Just move the sort_values doc here.
6230
- @deprecate_nonkeyword_arguments (version = "2.0" , allowed_args = ["self" , "by" ])
6230
+ @deprecate_nonkeyword_arguments (version = None , allowed_args = ["self" , "by" ])
6231
6231
@Substitution (** _shared_doc_kwargs )
6232
6232
@Appender (NDFrame .sort_values .__doc__ )
6233
6233
# error: Signature of "sort_values" incompatible with supertype "NDFrame"
Original file line number Diff line number Diff line change @@ -3225,7 +3225,7 @@ def update(self, other) -> None:
3225
3225
# ----------------------------------------------------------------------
3226
3226
# Reindexing, sorting
3227
3227
3228
- @deprecate_nonkeyword_arguments (version = "2.0" , allowed_args = ["self" ])
3228
+ @deprecate_nonkeyword_arguments (version = None , allowed_args = ["self" ])
3229
3229
def sort_values (
3230
3230
self ,
3231
3231
axis = 0 ,
Original file line number Diff line number Diff line change @@ -861,8 +861,10 @@ def test_sort_values_pos_args_deprecation(self):
861
861
# https://github.com/pandas-dev/pandas/issues/41485
862
862
df = DataFrame ({"a" : [1 , 2 , 3 ]})
863
863
msg = (
864
- r"Starting with Pandas version 2\.0 all arguments of sort_values except "
865
- r"for the arguments 'self' and 'by' will be keyword-only"
864
+ r"In a future version of pandas all arguments of DataFrame\. sort_values "
865
+ r"except for the argument 'by' will be keyword-only"
866
866
)
867
867
with tm .assert_produces_warning (FutureWarning , match = msg ):
868
- df .sort_values ("a" , 0 )
868
+ result = df .sort_values ("a" , 0 )
869
+ expected = DataFrame ({"a" : [1 , 2 , 3 ]})
870
+ tm .assert_frame_equal (result , expected )
Original file line number Diff line number Diff line change @@ -191,11 +191,13 @@ def test_sort_values_pos_args_deprecation(self):
191
191
# https://github.com/pandas-dev/pandas/issues/41485
192
192
ser = Series ([1 , 2 , 3 ])
193
193
msg = (
194
- r"Starting with Pandas version 2\.0 all arguments of sort_values except "
195
- r"for the argument 'self' will be keyword-only"
194
+ r"In a future version of pandas all arguments of Series\. sort_values "
195
+ r"will be keyword-only"
196
196
)
197
197
with tm .assert_produces_warning (FutureWarning , match = msg ):
198
- ser .sort_values (0 )
198
+ result = ser .sort_values (0 )
199
+ expected = Series ([1 , 2 , 3 ])
200
+ tm .assert_series_equal (result , expected )
199
201
200
202
201
203
class TestSeriesSortingKey :
You can’t perform that action at this time.
0 commit comments