From c66a8ca1714772141d079d87f84d09798536d6a3 Mon Sep 17 00:00:00 2001 From: Vasu Bhog Date: Tue, 27 Apr 2021 12:40:49 -0700 Subject: [PATCH] fix parameterized notebook output (#15233) --- .../workbench/contrib/notebook/browser/notebookActions.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/sql/workbench/contrib/notebook/browser/notebookActions.ts b/src/sql/workbench/contrib/notebook/browser/notebookActions.ts index d49cb707de..e219387e4d 100644 --- a/src/sql/workbench/contrib/notebook/browser/notebookActions.ts +++ b/src/sql/workbench/contrib/notebook/browser/notebookActions.ts @@ -363,11 +363,14 @@ export class RunParametersAction extends TooltipFromLabelAction { **/ public async openParameterizedNotebook(uri: URI): Promise { const editor = this._notebookService.findNotebookEditor(uri); - let modelContents = JSON.stringify(editor.model.toJSON()); + let modelContents = editor.model.toJSON(); + modelContents.cells.forEach(cell => { + cell.outputs = []; + }); let untitledUriPath = this._notebookService.getUntitledUriPath(path.basename(uri.fsPath)); let untitledUri = uri.with({ authority: '', scheme: 'untitled', path: untitledUriPath }); this._notebookService.openNotebook(untitledUri, { - initialContent: modelContents, + initialContent: JSON.stringify(modelContents), preserveFocus: true }); }