BUG: pd.DataFrame.transform recursively loops in some cases #34224
- [x] closes #34224 
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

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

> 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? > 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. Hello @pedrooa! Thanks for updating this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:





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

##### Comment last updated at 2020-06-03 02:13:44 UTC lgtm ping on green. thanks @pedrooa 