BUG: shows correct package name when import_optional_dependency is ca…
…lled. fixes #35948

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