Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Don't override global warnings filter #12245

Merged
merged 1 commit into from
Aug 19, 2018
Merged

Don't override global warnings filter #12245

merged 1 commit into from
Aug 19, 2018

Conversation

leezu
Copy link
Contributor

@leezu leezu commented Aug 19, 2018

Description

Currently import mxnet causes warnings.filterwarnings('default', category=DeprecationWarning) to be executed.
This is very bad, as there are valid use cases where our users may have decided to filter out DeprecationWarning and we should not overwrite their configuration.

It is also not always possible for users to change the warnings filter after mxnet has changed it. Consider a package that relies on mxnet (such as https://github.com/dmlc/gluon-nlp ) but also imports third-party packages that may raise warnings. If now gluon-nlp is imported, mxnet will overwrite the warnings filter and the user has no option to change it back to whatever settings he needs before gluon-nlp goes on to import other packages that may raise warnings.

Changes

  • Don't overwride global warnings.filterwarnings filter

Comments

@szha This breaks our notebooks for KDD18
@Roshrini Can we get this into mxnet 1.3 please?

Currently import mxnet causes warnings.filterwarnings('default', category=DeprecationWarning) to be executed.
This is very bad, as there are valid use cases where our users may have decided to filter out DeprecationWarning and we should not overwrite their configuration.
@leezu leezu requested a review from szha as a code owner August 19, 2018 11:06
@leezu
Copy link
Contributor Author

leezu commented Aug 19, 2018

This was added in a273078

@piiswrong do you mind if we remove it now (ie. merge this PR) given the issues it is causing?

@szha szha merged commit 46437b8 into apache:master Aug 19, 2018
@leezu leezu deleted the patch-8 branch August 19, 2018 17:52
XinYao1994 pushed a commit to XinYao1994/incubator-mxnet that referenced this pull request Aug 29, 2018
Currently import mxnet causes warnings.filterwarnings('default', category=DeprecationWarning) to be executed.
This is very bad, as there are valid use cases where our users may have decided to filter out DeprecationWarning and we should not overwrite their configuration.
anirudh2290 pushed a commit to anirudh2290/mxnet that referenced this pull request Sep 19, 2018
Currently import mxnet causes warnings.filterwarnings('default', category=DeprecationWarning) to be executed.
This is very bad, as there are valid use cases where our users may have decided to filter out DeprecationWarning and we should not overwrite their configuration.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants