Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEPR: positional arguments in favor of keyword arguments #48735

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/source/whatsnew/v2.0.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1075,8 +1075,8 @@ Metadata

Other
^^^^^
- Add future warnings in :meth:`DataFrameGroupBy.fillna` and :meth:`SeriesGroupBy.fillna` allowing only keyword arguments to be passed except ``value`` (:issue:`48395`)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move to section starting on L564 and reword like the others, so maybe "Deprecated...." instead of mentioning FutureWarning.

- Bug in :meth:`Series.searchsorted` inconsistent behavior when accepting :class:`DataFrame` as parameter ``value`` (:issue:`49620`)
-

.. ***DO NOT USE THIS SECTION***

Expand Down
3 changes: 3 additions & 0 deletions pandas/core/groupby/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
from pandas.util._decorators import (
Appender,
Substitution,
deprecate_nonkeyword_arguments,
doc,
)

Expand Down Expand Up @@ -788,6 +789,7 @@ def build_codes(lev_codes: np.ndarray) -> np.ndarray:
out = ensure_int64(out)
return self.obj._constructor(out, index=mi, name=self.obj.name)

@deprecate_nonkeyword_arguments(version=None, allowed_args=["self", "value"])
def fillna(
self,
value: object | ArrayLike | None = None,
Expand Down Expand Up @@ -2229,6 +2231,7 @@ def value_counts(
"""
return self._value_counts(subset, normalize, sort, ascending, dropna)

@deprecate_nonkeyword_arguments(version=None, allowed_args=["self", "value"])
def fillna(
self,
value: Hashable | Mapping | Series | DataFrame = None,
Expand Down