neo4j / neo4j-python-driver

Neo4j Bolt driver for Python
https://neo4j.com/docs/api/python-driver/current/
Other
898 stars 186 forks source link

Fix suppression of warnings for internal API usage #961

Closed robsdedude closed 1 year ago

robsdedude commented 1 year ago

Using warnings.catch_warning for suppressing warnings when using APIs internally that are preview/experimental/deprecated is a bad idea because the warnings module stores the configuration globally per module. This is not thread-safe. Therefore, the code was restructured to not rely of the warnings module to suppress those warnings. Instead, warning-free internal APIs are being used.