Closed fcollonval closed 2 years ago
Just to clarify, is this to match what's in JupyterLab's master
branch?
Yes
Otherwise for now if you open the examples/notebooks/OutputExamples.ipynb
, it fails because the attachments is YMap not a JSON object.
The error is a infinite recursive call within JSONExt.deepCopy
because the YMap reference its parent.
Thanks.
BTW, why do we enforce the "attachments"
field when we create a raw or markdown cell (with {}
when there are no attachments) and remove it when we get a cell (if there are are no attachments)?
why do we enforce the
"attachments"
field when we create a raw or markdown cell (with{}
when there are no attachments) and remove it when we get a cell (if there are are no attachments)?
No idea - but indeed it will be good to simply not set attachments in such case.
This was done in #27. Maybe @hbcarlos knows?
I made both create_ycell
and get_cell
symetrical in https://github.com/jupyter-server/jupyter_ydoc/pull/77/commits/8a8c7385ed684c17429e3f4509b993e574237f03: we remove attachments if it's an empty dict.
Thanks. BTW, why do we enforce the "attachments" field when we create a raw or markdown cell (with {} when there are no attachments) and remove it when we get a cell (if there are are no attachments)?
Because we need to initialize that attribute even when it is empty.
Why are we deleting it before saving it? I don't recall. Probably the nbformat doesn't allow empty attachments.
Because we need to initialize that attribute even when it is empty.
Why? The documentation says:
"The attachments
dictionary is an optional field and can be undefined or empty if the cell does not have any attachments."
Thanks!
@meeseeksdev please backport to 0.2.x
@meeseeksdev please backport to 0.2.x
Oh, I didn't know we could do that here :smile:
Actually I don't have the right to do it. But you should be able.
@meeseeksdev please backport to 0.2.x
It seems the Meeseeksdev GitHub App is not installed on this repository :cry:
You should be able to add it in the settings of the project.
@MeeseeksDev Hello
Helloooo @davidbrochart, I'm Mr. Meeseeks! Look at me!
@meeseeksdev please backport to 0.2.x
You should be able to add it in the settings of the project.
Seems to work now!
This is similar to https://github.com/jupyter-server/jupyter_ydoc/pull/50
To test the changes, make sure you remove the jupyter_ystore database.