TST #24444 added tests
At last, there are no issues at all. I've made a new PR.

- [x] closes #24444
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`

Thanks @OlivierLuG 

> I've made a new PR to update master. Sorry, there iare conflict. I don't know how to handle that.

There's instructions [here](https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#updating-your-pull-request) in the contributing guide Thanks @OlivierLuG 