Warnings are not shown in the Notebook Editor.
.py from terminal, I get the warning message, but if I run it inside a cell in the Notebook editor, nothing appears.
import warnings
warnings.warn('Warning Message')
_Please provide as much info as you readily know_
Microsoft Data Science for VS Code Engineering Team: @rchiodo, @IanMatthewHuff, @DavidKutu, @DonJayamanne, @greazer
@ashtou Thanks for reporting this, and sorry about the issue. I took a peek and I repro the same thing. A warning is shown in a jupyter notebook, but not in our notebook editor view. We'll triage this issue.
@IanMatthewHuff thanks. Yes, please do. Data-science packages often provide important warnings.
For anyone else who might face the same problem, you'll need to use warnings.simplefilter(action="default") in the notebooks for now.
You can automatically do this for every notebook or interactive window by adding the following to settings.json
"python.dataScience.runStartupCommands":
["import warnings",
"warnings.simplefilter(action='default')"
]
Most helpful comment
@IanMatthewHuff thanks. Yes, please do. Data-science packages often provide important warnings.
For anyone else who might face the same problem, you'll need to use
warnings.simplefilter(action="default")in the notebooks for now.