-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: pd.DataFrame.transform recursively loops in some cases #34224 #34377
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.
can you add the test which hits this
Sure! Do You mean singling out a test that already exists and hits this, or creating a new test for this case? |
You'll want to create a new test for a case that was raising the RecursionError before, but now raises a more appropriate error / message. You could use the example from the original issue. |
pandas/tests/series/test_apply.py
Outdated
def test_transform_none_to_type(self): | ||
df = pd.DataFrame({"a": [None]}) | ||
|
||
with pytest.raises(TypeError): | ||
df.transform({"a": int}) |
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 also include the issue number as a comment and test the new error message?
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.
looks good can u add a whats new note
reshaping bug fix for 1.1
lgtm ping on green. |
doc/source/whatsnew/v1.1.0.rst
Outdated
@@ -960,6 +960,7 @@ Reshaping | |||
- Bug in :func:`concat` was not allowing for concatenation of ``DataFrame`` and ``Series`` with duplicate keys (:issue:`33654`) | |||
- Bug in :func:`cut` raised an error when non-unique labels (:issue:`33141`) | |||
- Ensure only named functions can be used in :func:`eval()` (:issue:`32460`) | |||
- Bug in :func:`aggregate` was causing recursive loop in some cases (:issue:`34224`) |
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.
actually this is not right, can you put :func:`DataFrame.aggregate`
and :func:`Series.aggregate`
.
pls ping on green.
thanks @pedrooa |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff
Error handling within try/except in aggregate function of frame.py file