incubator-toree icon indicating copy to clipboard operation
incubator-toree copied to clipboard

[TOREE-541] Reply message should implement status field

Open pan3793 opened this issue 2 years ago • 8 comments

This PR refers to https://jupyter-client.readthedocs.io/en/latest/messaging.html to revise the Jupyter message protocol implementation

All reply messages have a 'status' field ...

A trait ReplyContent is introduced to make sure all reply messages meet this contract.

One exception is "connect_reply", because

Deprecated since version 5.1: connect_request/reply have not proved useful, and are considered deprecated. Kernels are not expected to implement handlers for this message.

https://jupyter-client.readthedocs.io/en/latest/messaging.html#connect

pan3793 avatar Aug 06 '23 20:08 pan3793

kindly ping @lresende and @kevin-bates, would you mind taking a look when you have time?

pan3793 avatar Aug 08 '23 13:08 pan3793

I see a lot of updates adding status "ok"... how about error conditions when something fail?

lresende avatar Aug 09 '23 00:08 lresende

@lresende I think the code won't reach there if something fails before it. Note that, only a few kind simple reply messages did not implement the status, for message like ExecuteReply which already has status field with properly handled.

pan3793 avatar Aug 09 '23 00:08 pan3793

@lresende FYI, I changed the code to use type XyzReplyOk = XyzReply to keep consistent with the current code, no functionality changes.

pan3793 avatar Aug 09 '23 01:08 pan3793

@lresende @kevin-bates would you mind taking another look? IMO this does not change the state of error handling, should be safe.

pan3793 avatar Aug 10 '23 03:08 pan3793

Have you tested this with real job notebooks on latest jupyterlab 3.x and no side effects?

lresende avatar Aug 11 '23 00:08 lresende

@lresende I tested it with built-in examples/magic-tutorial.ipynb, everything goes well

image image

pan3793 avatar Aug 11 '23 02:08 pan3793

Kindly ping @lresende @kevin-bates

pan3793 avatar Aug 25 '23 02:08 pan3793

@lresende I rebased it on the latest master and fixed the conflict, please take a look when you have time.

pan3793 avatar Aug 26 '24 16:08 pan3793