TST: Fix failing test from #37027
Part of #30999
- [ ] tests added / passed
- [ ] passes `black pandas`
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
Is it possible to update the error messages to make CI pass rather than reverting entirely? @dsaxton updated. all checks passed. could i get the `hacktoberfest-accepted` label for this PR? thanks much @hongshaoyang 