Skip to content

Errors not rendering for Jupyter notebook preview

Summary

Errors are not rendering for Jupyter Notebook previews.

Steps to reproduce

Example Project

https://gitlab.com/mbadeau/zd-340174/-/blob/main/Untitled0.ipynb

What is the current bug behavior?

Currently errors are not rendered for Jupyter notebooks.

What is the expected correct behavior?

The rendering should match that shown for iPython output. In this example, it's a NameError

Relevant logs and/or screenshots

Correct rendering on Jupyter notebook server: Screen_Shot_2022-11-04_at_15.48.08

Incorrect rendering on GitLab.com: Screen_Shot_2022-11-04_at_15.48.29

Output of checks

This bug happens on GitLab.com

Possible fixes

It seems the outputs with "output_type": "error" may be ignored.

      "outputs": [
        {
          "output_type": "error",
          "ename": "NameError",
          "evalue": "ignored",
          "traceback": [
            "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
            "\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
            "\u001b[0;32m<ipython-input-2-4e1243bd22c6>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mtest\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
            "\u001b[0;31mNameError\u001b[0m: name 'test' is not defined"
          ]
        }
      ]