Skip to content

Commit

Permalink
revert grid streaming changes (#12650) (#12652)
Browse files Browse the repository at this point in the history
(cherry picked from commit cf9754f)

Co-authored-by: Lucy Zhang <luczhan@microsoft.com>
  • Loading branch information
Charles-Gagnon and lucyzhang929 committed Sep 29, 2020
1 parent 4082170 commit 1b5c54d
Show file tree
Hide file tree
Showing 4 changed files with 125 additions and 79 deletions.
4 changes: 1 addition & 3 deletions src/sql/azdata.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4902,8 +4902,6 @@ declare module 'azdata' {
*
* @param disposeOnDone - Whether to dispose of the future when done.
*
* @param cellId - Cell id (used by queryRunner)
*
* @returns A kernel future.
*
* #### Notes
Expand All @@ -4918,7 +4916,7 @@ declare module 'azdata' {
*
* **See also:** [[IExecuteReply]]
*/
requestExecute(content: IExecuteRequest, disposeOnDone?: boolean, cellUri?: string): IFuture;
requestExecute(content: IExecuteRequest, disposeOnDone?: boolean): IFuture;

/**
* Send a `complete_request` message.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ suite('Cell Model', function (): void {

test('Execute returns error status', async function (): Promise<void> {
mockKernel.setup(k => k.requiresConnection).returns(() => false);
mockKernel.setup(k => k.requestExecute(TypeMoq.It.isAny(), TypeMoq.It.isAny(), TypeMoq.It.isAny())).returns(() => {
mockKernel.setup(k => k.requestExecute(TypeMoq.It.isAny(), TypeMoq.It.isAny())).returns(() => {
let replyMsg: nb.IExecuteReplyMsg = <nb.IExecuteReplyMsg>{
content: <nb.IExecuteReply>{
execution_count: 1,
Expand All @@ -796,7 +796,7 @@ suite('Cell Model', function (): void {

test('Execute returns abort status', async function (): Promise<void> {
mockKernel.setup(k => k.requiresConnection).returns(() => false);
mockKernel.setup(k => k.requestExecute(TypeMoq.It.isAny(), TypeMoq.It.isAny(), TypeMoq.It.isAny())).returns(() => {
mockKernel.setup(k => k.requestExecute(TypeMoq.It.isAny(), TypeMoq.It.isAny())).returns(() => {
let replyMsg: nb.IExecuteReplyMsg = <nb.IExecuteReplyMsg>{
content: <nb.IExecuteReply>{
execution_count: 1,
Expand All @@ -815,7 +815,7 @@ suite('Cell Model', function (): void {
test('Execute throws exception', async function (): Promise<void> {
let testMsg = 'Test message';
mockKernel.setup(k => k.requiresConnection).returns(() => false);
mockKernel.setup(k => k.requestExecute(TypeMoq.It.isAny(), TypeMoq.It.isAny(), TypeMoq.It.isAny())).returns(() => {
mockKernel.setup(k => k.requestExecute(TypeMoq.It.isAny(), TypeMoq.It.isAny())).returns(() => {
throw new Error(testMsg);
});

Expand Down
2 changes: 1 addition & 1 deletion src/sql/workbench/services/notebook/browser/models/cell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ export class CellModel extends Disposable implements ICellModel {
const future = kernel.requestExecute({
code: content,
stop_on_error: true
}, false, this._cellUri.toString());
}, false);
this.setFuture(future as FutureInternal);
this.fireExecutionStateChanged();
// For now, await future completion. Later we should just track and handle cancellation based on model notifications
Expand Down

0 comments on commit 1b5c54d

Please sign in to comment.