Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 12, 2024

Conversation

robsdedude
Copy link
Member

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: #961

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.
Copy link
Contributor

@bigmontz bigmontz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️

@robsdedude robsdedude merged commit 5da08ae into neo4j:4.4 Apr 12, 2024
12 checks passed
@robsdedude robsdedude deleted the fix/warning-global-state-4.4 branch April 12, 2024 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants