Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Synapse-Spark]-Track2 spark client SDK based on autorest generated code and manual convenient layer #12487

Closed
wants to merge 5 commits into from

Conversation

sunsw1994
Copy link

No description provided.

Copy link
Member

@xirzec xirzec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks really nice for a draft PR!

So nice, in fact, that I decided to read through and leave some comments. My apologies if you weren't ready for feedback yet. :)

"author": "Microsoft Corporation",
"description": "Azure client library for Azure Synapse Spark.",
"version": "1.0.0-beta.1",
"dependencies": {
Copy link
Member

@xirzec xirzec Nov 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: could you alpha-sort the keys in dependencies and devDependencies? #Resolved

Copy link
Author

@sunsw1994 sunsw1994 Nov 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great recommend, will update at next commit. #Resolved


// @public
export interface SparkClientOptions extends PipelineOptions {
endpoint?: string;
Copy link
Member

@xirzec xirzec Nov 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how is this endpoint different from the workspaceEndpoint in the constructor? #Resolved

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Useless,. will removed that.


In reply to: 521600916 [](ancestors = 521600916)

cancelSparkSession(sessionId: number, options?: CancelSparkSessionOptions): Promise<OperationResponse>;
cancelSparkStatement(sessionId: number, statementId: number, options?: CancelSparkStatementOptions): Promise<OperationResponse>;
createSparkBatchJob(sparkBatchJobOptions: SparkBatchJobOptions, options?: CreateSparkBatchJobOptions): Promise<CreateSparkBatchJobResponse>;
createSparkSeesion(sparkSessionOptions: SparkSessionOptions, options?: CreateSparkSessionOptions): Promise<CreateSparkSessionResponse>;
Copy link
Member

@xirzec xirzec Nov 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: session #Resolved

Copy link
Author

@sunsw1994 sunsw1994 Nov 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch, thanks! #Resolved

listSparkSessions(options?: ListSparkSessionsOptions): Promise<ListSparkSessionsResponse>;
listSparkStatements(sessionId: number, options?: ListSparkStatementsOptions): Promise<ListSparkStatementsResponse>;
resetSparkSessionTimeout(sessionId: number, options: ResetSparkSessionTimeoutOptions): Promise<OperationResponse>;
readonly workspaceEndpoint: string;
Copy link
Member

@xirzec xirzec Nov 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why make this public? #Resolved

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems useless, nowhere need to invoke it, will remove this var at next commit.


In reply to: 521601506 [](ancestors = 521601506)

}

// @public (undocumented)
export class SparkClient {
Copy link
Member

@xirzec xirzec Nov 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a lot of these methods look like they're managing Long Running Operations. Can we use our standard LRO shape for this?

https://azure.github.io/azure-sdk/typescript_design.html#ts-lro
https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/core-lro

Maybe that's not the right primitive, but I'm not understanding how these operations are different right now. #Pending

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean Create operation need to support LRO? I think we can stay current function, because that api has been used for a not short time at different languages, we don't get feedback need to support LRO.
Another question, can we keep this createSparkSession for now and add a new beginCreateSparkSession supoortted LRO in the future?


In reply to: 521603316 [](ancestors = 521603316)

Copy link
Member

@xirzec xirzec Nov 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One of the principles of the SDK is consistency, so I would hesitate to offer multiple ways to initiate / monitor / cancel a long running operation other than to use our LRO primitive.

I would think it would be simpler to have a consistent abstraction, especially since you should be able to change the internal workings of the LRO as needed. #Pending

sdk/synapse/synapse-spark/src/SparkClient.ts Outdated Show resolved Hide resolved
export function uniqueString(): string {
return isPlaybackMode()
? ""
: Math.random()
Copy link
Member

@xirzec xirzec Nov 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason not to use a guid here? #Resolved

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it needed? I refer it from

export function uniqueString(): string {


In reply to: 521615219 [](ancestors = 521615219)

Copy link
Member

@xirzec xirzec Nov 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sadasant any thoughts? #Resolved

env.AZURE_CLIENT_SECRET
);

const worksapceName = getWorkspaceName();
Copy link
Member

@xirzec xirzec Nov 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: workspaceName #Resolved

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching it!


In reply to: 521615392 [](ancestors = 521615392)

import { env } from "@azure/test-utils-recorder";
import * as assert from "assert";

// Async iterator's polyfill for Node 8
Copy link
Member

@xirzec xirzec Nov 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this really need to be inlined? core-asynciterator-polyfill is supposed to take care of this

https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/core-asynciterator-polyfill #Resolved

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will remove it.


In reply to: 521615917 [](ancestors = 521615917)

return Sparkpool;
}

export async function assertThrowsAbortError(cb: () => Promise<any>): Promise<void> {
Copy link
Member

@xirzec xirzec Nov 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming this helper is because chai's assert.throws doesn't work properly with async functions? #Resolved

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest, I am not sure for that. I just refer to this helper from

export async function assertThrowsAbortError(cb: () => Promise<any>): Promise<void> {


In reply to: 521617527 [](ancestors = 521617527)

@sunsw1994
Copy link
Author

sunsw1994 commented Nov 12, 2020

This looks really nice for a draft PR!

So nice, in fact, that I decided to read through and leave some comments. My apologies if you weren't ready for feedback yet. :)


In reply to: 528485992 [](ancestors = 528485992)

@sunsw1994 sunsw1994 requested a review from xirzec November 16, 2020 02:28
@xirzec
Copy link
Member

xirzec commented Nov 17, 2020

@xirzec Thank you very much for reviewing! I have gone through your comments and fix most of these following your guidance. A question as we mention at below comment, synapse service plan to do board review by next week, we estimate there will be some changes from swagger, some common issuse caused by swagger will be fixed at that time.

Glad to hear it! You may find that not all languages have codegen that supports fancier swagger features, though we're investing in catching up.

We also want to confirm with you that we can't check in SDK before board review, right? Can code review from you and board review are in parallel?😊

You absolutely can check into the repo before the review, you just can't release a beta package.
#Resolved

@sunsw1994 sunsw1994 marked this pull request as ready for review November 17, 2020 12:55
@sunsw1994 sunsw1994 changed the title [Synapse-Spark][Draft for Review]-Track2 spark client SDK based on autorest generated code and manual convenient layer [Synapse-Spark]-Track2 spark client SDK based on autorest generated code and manual convenient layer Nov 17, 2020
@sunsw1994
Copy link
Author

@jeff Fisher Thanks for pointing that out. Do you mean we can't release a beta package as public preview after code check in?
I see there are released beta package : https://azure.github.io/azure-sdk/releases/latest/#javascript

Synapse service team side hope to check in beta.1 code and release a package (synapse spark/artifacts/accesscontrol) for preview by this month(11.30). So want to confirm with you whether there are any rick for this target from you or ts sdk side. Feel free to ping me at teams or email(alias:shangsu). Thanks a lot!


In reply to: 728627409 [](ancestors = 728627409)

@xirzec
Copy link
Member

xirzec commented Nov 17, 2020

Synapse service team side hope to check in beta.1 code and release a package (synapse spark/artifacts/accesscontrol) for preview by this month(11.30). So want to confirm with you whether there are any rick for this target from you or ts sdk side. Feel free to ping me at teams or email(alias:shangsu). Thanks a lot!

My apologies @sunsw1994, I spoke without having all the context. We have a ship freeze in December, but there has been a special dispensation granted for Synapse.

@jonathandturner is going to be the main driver for this and I will work with him on unblocking you as best I can. I have a feeling that beta1 is going to be a little rough, but that's okay since breaking changes are allowed between betas. 😄 #Resolved

@xirzec xirzec requested a review from sophiajt November 19, 2020 21:21
@ramya-rao-a
Copy link
Contributor

Closing this PR as it has been superseded by #12713

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants