Skip to content

REGR: Fix signature of GroupBy.expanding #61361

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

Closed
rhshadrach opened this issue Apr 26, 2025 · 4 comments
Closed

REGR: Fix signature of GroupBy.expanding #61361

rhshadrach opened this issue Apr 26, 2025 · 4 comments
Labels
Blocker Blocking issue or pull request for an upcoming release Bug Groupby Regression Functionality that used to work in a prior pandas version Window rolling, ewma, expanding
Milestone

Comments

@rhshadrach
Copy link
Member

rhshadrach commented Apr 26, 2025

Ref: #61352 (comment)

#61352 replaced *args and **kwargs in the signature of GroupBy.expanding. However I believe further arguments need to be added. We could also revert the PR instead.

@rhshadrach rhshadrach added Blocker Blocking issue or pull request for an upcoming release Bug Groupby Regression Functionality that used to work in a prior pandas version Window rolling, ewma, expanding labels Apr 26, 2025
@rhshadrach rhshadrach added this to the 3.0 milestone Apr 26, 2025
@arthurlw
Copy link
Contributor

Thanks for pointing this out! Just to confirm, which additional arguments do you think should be included in the signature/documentation?

@rhshadrach
Copy link
Member Author

From the old docstrings:

Arguments are the same as :meth:DataFrame.rolling except that step cannot be specified.

I believe that's accurate, but we should confirm.

@arthurlw
Copy link
Contributor

When I was writing the documentation, I referred to the Expanding class and the DataFrame.expanding signature. Both expect min_periods, axis, and method as parameters.

DataFrame.rolling accepts several additional arguments, such as window, center, and win_type, which don't apply to expanding windows.

Also the docstring above was added by me in #61274, though after reviewing this more carefully, I believe that was a mistake.

@rhshadrach
Copy link
Member Author

Also the docstring above was added by me in #61274, though after reviewing this more carefully, I believe that was a mistake.

At my request!

I missed that Expanding is part of the MRO for ExpandingGroupby. The current signature looks correct to me. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocker Blocking issue or pull request for an upcoming release Bug Groupby Regression Functionality that used to work in a prior pandas version Window rolling, ewma, expanding
Projects
None yet
Development

No branches or pull requests

2 participants