pandas-dev / pandas

Flexible and powerful data analysis / manipulation library for Python, providing labeled data structures similar to R data.frame objects, statistical functions, and much more
https://pandas.pydata.org
BSD 3-Clause "New" or "Revised" License
42.57k stars 17.56k forks source link

BUG: Allow show_versions to work for any module that raises an exception #59114

Open mroeschke opened 4 days ago

mroeschke commented 4 days ago

The use of import_optional_dependency only can ignore ImportError, but as seen in the issue essentially any exception can be raised with an import.

Also cleans up some redundancy of optional dependencies being listed.

Dr-Irv commented 3 days ago

@mroeschke I think it may be a while until we do a 3.0 release, and with numpy 2.0 now released, we might be seeing more reports of problems with show_versions(), so we might need to do a 2.2.3 release with this patch to avoid lots of people reporting issues.

mroeschke commented 2 days ago

OK we can backport this change just in case