Skip to content

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

Merged
merged 9 commits into from
Jun 3, 2020

Conversation

pedrooa
Copy link
Contributor

@pedrooa pedrooa commented May 26, 2020

Error handling within try/except in aggregate function of frame.py file

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.

can you add the test which hits this

@jreback jreback added the Reshaping Concat, Merge/Join, Stack/Unstack, Explode label May 26, 2020
@pedrooa
Copy link
Contributor Author

pedrooa commented May 27, 2020

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?

@dsaxton
Copy link
Member

dsaxton commented May 27, 2020

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.

@pep8speaks
Copy link

pep8speaks commented May 27, 2020

Hello @pedrooa! 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-06-03 02:13:44 UTC

Comment on lines 466 to 470
def test_transform_none_to_type(self):
df = pd.DataFrame({"a": [None]})

with pytest.raises(TypeError):
df.transform({"a": int})
Copy link
Member

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?

@pedrooa pedrooa requested a review from jreback May 28, 2020 04:29
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.

looks good can u add a whats new note
reshaping bug fix for 1.1

@jreback jreback added this to the 1.1 milestone Jun 1, 2020
@jreback
Copy link
Contributor

jreback commented Jun 1, 2020

lgtm ping on green.

@@ -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`)
Copy link
Contributor

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.

@jreback jreback merged commit 433c900 into pandas-dev:master Jun 3, 2020
@jreback
Copy link
Contributor

jreback commented Jun 3, 2020

thanks @pedrooa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: pd.DataFrame.transform recursively loops in some cases
4 participants