neo4j / neo4j-python-driver

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

[4.4] Fix suppression of warnings for internal API usage #1040

Closed robsdedude closed 3 months ago

robsdedude commented 3 months 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.

Backport of: https://github.com/neo4j/neo4j-python-driver/pull/961