-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Add test to ensure, that bug will not occur again. #33058 #33072
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @phofl lgtm pending green
marked as 1.1 but could backport if fixed on 1.0.x |
@phofl can you merge upstream master |
…d_test_33058 � Conflicts: � pandas/tests/groupby/test_apply.py
@simonjayhawkins Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I'm not sure this is worth adding a test for - mutating the argument during a .apply
seems fraught with peril and I'm a little hesitant to make guarantees about behavior
@jorisvandenbossche do you have a strong preference towards adding this?
this is fine, we currently support mutating inside an apply, though we have an issue to deprecate. |
sounds good |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see my comments & ping on green.
@@ -880,3 +880,24 @@ def test_apply_function_index_return(function): | |||
index=pd.Index([1, 2, 3], name="id"), | |||
) | |||
tm.assert_series_equal(result, expected) | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you put this in a new file, call it test_apply_mutate.py
; there are 2 tests
pandas/tests/groupby/test_groupby.py:def test_mutate_groups():
pandas/tests/groupby/test_groupby.py:def test_no_mutate_but_looks_like():
that should also be moved there.
Thanks @phofl |
Sorry @jreback merged while you were commented; i can do in a follow up |
thanks @WillAyd |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff
Should I add a whatsnew entry? It's not really new, if it is backported to 1.0.1.