Notebooks: Fix Notebook validation Error when opened in Jupyter (#14110)

* delete transient node for display data

* add comment
This commit is contained in:
Lucy Zhang
2021-01-29 14:40:02 -08:00
committed by GitHub
parent 72b8d96dbc
commit 667c12abdc

View File

@@ -718,6 +718,10 @@ export class CellModel extends Disposable implements ICellModel {
if (this._outputs.length > 0) {
for (let i = 0; i < this._outputs.length; i++) {
if (this._outputs[i].output_type === 'execute_result') {
// Deletes transient node in the serialized JSON
// "Optional transient data introduced in 5.1. Information not to be persisted to a notebook or other documents."
// (https://jupyter-client.readthedocs.io/en/stable/messaging.html)
delete output['transient'];
this._outputs.splice(i, 0, this.rewriteOutputUrls(output));
this.fireOutputsChanged();
added = true;