Skip to content

BUG: Use args and kwargs in Rolling.apply #33983

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

Merged
merged 9 commits into from
May 15, 2020

Conversation

mproszewska
Copy link
Contributor

@mroeschke mroeschke added Bug Window rolling, ewma, expanding labels May 5, 2020
@jreback jreback added this to the 1.1 milestone May 5, 2020
Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

needs a release note.

we actually want to test this for both .rolling.apply as well as .groupby.rolling.apply (as you did).

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

pls also add a whatsnew note, 1.1, bug fixes, in groupby/rollining section

@pep8speaks
Copy link

pep8speaks commented May 10, 2020

Hello @mproszewska! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2020-05-15 11:38:03 UTC

@mproszewska mproszewska changed the title BUG: Use kwargs in Rolling.apply BUG: Use args and kwargs in Rolling.apply May 10, 2020
idx = Index(["gr", "a"])
expected = DataFrame([[11.0, 11.0], [11.0, 12.0]], columns=idx)

result = df.rolling(1).apply(foo, kwargs={"par": 10})
Copy link
Member

Choose a reason for hiding this comment

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

Could you parameterize over the kwargs & args?

pytest.mark.parameterize('args_kwargs', [[None, {"par": 10}], [(10,), None]])

@jreback jreback modified the milestones: 1.1, 1.0.4 May 15, 2020
@jreback jreback merged commit e66e5c3 into pandas-dev:master May 15, 2020
@jreback
Copy link
Contributor

jreback commented May 15, 2020

thanks @mproszewska

cc @simonjayhawkins marked for 1.04 as well

simonjayhawkins added a commit that referenced this pull request May 15, 2020
@mproszewska mproszewska deleted the bug-kwargs branch May 15, 2020 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Window rolling, ewma, expanding
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Using kwargs in Rolling.apply()
5 participants