BUG: pd.DataFrame.transform recursively loops in some cases #34224 by pedrooa · Pull Request #34377 · pandas-dev/pandas (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation9 Commits9 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

pedrooa

@pedrooa

jreback

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

@pedrooa

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

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.

@pedrooa

@pep8speaks

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

@pedrooa

dsaxton

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})

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

jreback

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

@pedrooa

@pedrooa

jreback

@jreback

jreback

@@ -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`)

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

Labels

Reshaping

Concat, Merge/Join, Stack/Unstack, Explode