Skip to content

Commit f4da184

Browse files
committed
assert result in test
1 parent f85d72c commit f4da184

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

doc/source/whatsnew/v1.3.0.rst

-1
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,6 @@ Deprecations
650650
- Deprecated using ``usecols`` with out of bounds indices for ``read_csv`` with ``engine="c"`` (:issue:`25623`)
651651
- Deprecated passing arguments as positional in (:issue:`41485`) :
652652
- :meth:`DataFrame.interpolate` (other than ``"method"``) and :meth:`Series.interpolate`
653-
- :meth:`DataFrame.sort_values` (other than ``"by"``) and :meth:`Series.sort_values`
654653
- :meth:`DataFrame.set_index` (other than ``"keys"``)
655654

656655
.. ---------------------------------------------------------------------------

pandas/core/frame.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5352,7 +5352,7 @@ def shift(
53525352
periods=periods, freq=freq, axis=axis, fill_value=fill_value
53535353
)
53545354

5355-
@deprecate_nonkeyword_arguments(version="2.0", allowed_args=["self", "keys"])
5355+
@deprecate_nonkeyword_arguments(version=None, allowed_args=["self", "keys"])
53565356
def set_index(
53575357
self,
53585358
keys,

pandas/tests/frame/methods/test_set_index.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -709,8 +709,10 @@ def test_drop_pos_args_deprecation(self):
709709
# https://github.com/pandas-dev/pandas/issues/41485
710710
df = DataFrame({"a": [1, 2, 3]})
711711
msg = (
712-
r"Starting with Pandas version 2\.0 all arguments of set_index except for "
713-
r"the arguments 'self' and 'keys' will be keyword-only"
712+
r"In a future version of pandas all arguments of DataFrame\.set_index "
713+
r"except for the argument 'keys' will be keyword-only"
714714
)
715715
with tm.assert_produces_warning(FutureWarning, match=msg):
716-
df.set_index("a", True)
716+
result = df.set_index("a", True)
717+
expected = DataFrame(index=Index([1, 2, 3], name="a"))
718+
tm.assert_frame_equal(result, expected)

0 commit comments

Comments
 (0)