TST: group by - apply Key Error
- [x] closes #44310  
- [X] tests added / passed
- [X] ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them
- [ ] whatsnew entry

Hello @brunoacpcosta! 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 2021-12-10 18:40:54 UTC Thanks for the help! Thanks @brunoacpcosta 