Skip to content
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

nbclient.exceptions.DeadKernelError if Python Warnings Filter set to 'default' #660

Open
matthewfeickert opened this issue Apr 6, 2022 · 0 comments

Comments

@matthewfeickert
Copy link
Contributor

matthewfeickert commented Apr 6, 2022

Question

👋 Hi. While trying to get a nightly notebook pytest test working again with modern papermill and scrapbook (c.f. scikit-hep/pyhf#1841) I noticed that if I have Python filter warnings set to 'default', I can get a nbclient.exceptions.DeadKernelError from papermill if the notebook being executed has any IPython/Jupyter magics like shell evaluation with !.

Example from scikit-hep/pyhf#1841:

    - name: Test example notebooks
      shell: bash
      run: |
        # Override the ini option for filterwarnings with an empty list to disable error
        # on filterwarnings as testing for notebooks to run with the latest API, not if
        # Jupyter infrastructure is warning free.
        # Though still show warnings by setting warning control to 'default'.
        export PYTHONWARNINGS='default'
        pytest --override-ini filterwarnings= tests/test_notebooks.py

Do you have any ideas why setting PYTHONWARNINGS='default' which will

print the first occurrence of matching warnings for each location (module + line number) where the warning is issued

would cause a nbclient.exceptions.DeadKernelError, which goes away if PYTHONWARNINGS is not set?

Log files

There is a log file for

$ PYTHONWARNINGS='default' pytest --override-ini filterwarnings= tests/test_notebooks.py -k test_xml_importexport &> /tmp/pythonwarnings_log.txt

at scikit-hep/pyhf#1840 (comment), which I can link here: https://github.com/scikit-hep/pyhf/files/8425002/pythonwarnings_log.txt

Related Issues and PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant