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