Notebook Parameterization - Papermill Compatibility (#13034)

* Parameterization papermill fix

* Utilize isParameter instead

* Address PR comments, and fix tests

* Address comment
This commit is contained in:
Vasu Bhog
2020-10-23 20:32:55 -05:00
committed by GitHub
parent bf9fd5a3b8
commit cb30dd1893
5 changed files with 28 additions and 14 deletions

View File

@@ -15,7 +15,6 @@ import { NotebookEditor } from 'sql/workbench/contrib/notebook/browser/notebookE
import { NBTestQueryManagementService } from 'sql/workbench/contrib/notebook/test/nbTestQueryManagementService';
import * as stubs from 'sql/workbench/contrib/notebook/test/stubs';
import { NotebookEditorStub } from 'sql/workbench/contrib/notebook/test/testCommon';
import { CellModel } from 'sql/workbench/services/notebook/browser/models/cell';
import { ICellModel, NotebookContentChange } from 'sql/workbench/services/notebook/browser/models/modelInterfaces';
import { INotebookEditor, INotebookParams, INotebookService, NotebookRange } from 'sql/workbench/services/notebook/browser/notebookService';
import { NotebookService } from 'sql/workbench/services/notebook/browser/notebookServiceImpl';
@@ -61,13 +60,12 @@ import { TestNotificationService } from 'vs/platform/notification/test/common/te
import { INotificationService } from 'vs/platform/notification/common/notification';
class NotebookModelStub extends stubs.NotebookModelStub {
private _cells: Array<ICellModel> = [new CellModel(undefined, undefined)];
public contentChangedEmitter = new Emitter<NotebookContentChange>();
private _kernelChangedEmitter = new Emitter<nb.IKernelChangedArgs>();
private _onActiveCellChanged = new Emitter<ICellModel>();
get cells(): ReadonlyArray<ICellModel> {
return this._cells;
get cells(): ICellModel[] {
return this.cells;
}
public get contentChanged(): Event<NotebookContentChange> {
return this.contentChangedEmitter.event;

View File

@@ -19,7 +19,7 @@ import { QueryTextEditor } from 'sql/workbench/browser/modelComponents/queryText
import { IContextViewProvider, IDelegate } from 'vs/base/browser/ui/contextview/contextview';
export class NotebookModelStub implements INotebookModel {
constructor(private _languageInfo?: nb.ILanguageInfo) {
constructor(private _languageInfo?: nb.ILanguageInfo, private _cells?: ICellModel[]) {
}
trustedMode: boolean;
language: string;
@@ -31,8 +31,8 @@ export class NotebookModelStub implements INotebookModel {
onCellChange(cell: ICellModel, change: NotebookChangeType): void {
// Default: do nothing
}
get cells(): ReadonlyArray<ICellModel> {
throw new Error('method not implemented.');
get cells(): ICellModel[] | undefined {
return this._cells;
}
get activeCell(): ICellModel {
throw new Error('method not implemented.');