1. Jupyter notebook and JupyterLab do indeed use completely different
message processors.
2. The execute_result vs display_data difference you see is from how you
evaluated things. execute_result basically returns the result of displaying
the last line of execution. display_data messages come from explicitly
displaying something. To see the display_data message, do something like
`display(HTML(...))`.

Thanks,

Jason


On Mon, Apr 22, 2019 at 10:30 PM Nils Bruin <[email protected]> wrote:

> Dear Matt,
>
> Thank you very much! That worked quite well. I'm recording some details
> below for future reference.
>
> In fact, nbconvert raised an error complaining that "metadata" was missing
> (from the content), so adding a "metadata: {}" to the content dict of the
> display_data message seems to resolve the issue.
>
> It looks like JupyterLab just swallows that error (it should probably log
> it). Somehow, JupyNotebook doesn't seem bothered so it probably uses a
> different message parser.
>
> By adding a `print(msg)` line to line 359 of
> nbconvert/preprocesors/execute.py it was easy to confirm what the message
> content was that caused the problem.
>
> Further differences: the IPython.display.HTML(...) results in a
> "execute_result" message; not a "display_data" message. I'd be happy
> returning one of those instead, but when I read the jupyter kernel protocol
> docs, I did find display_data and not execute_result. It may be a later
> addition?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Project Jupyter" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jupyter/3ff07e3b-e0fc-4531-966f-14ac875d0655%40googlegroups.com
> <https://groups.google.com/d/msgid/jupyter/3ff07e3b-e0fc-4531-966f-14ac875d0655%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/CAPDWZHw2qvd%3DYa8QLoZfLM8J0VXu13sd4F%3DeMx%3Dh74mB0zYcAQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to