-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Conversation
…nual convenient layer
5dd628c
to
1f8a171
Compare
There was a problem hiding this 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": { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: session #Resolved
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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
export function uniqueString(): string { | ||
return isPlaybackMode() | ||
? "" | ||
: Math.random() |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: workspaceName #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { env } from "@azure/test-utils-recorder"; | ||
import * as assert from "assert"; | ||
|
||
// Async iterator's polyfill for Node 8 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return Sparkpool; | ||
} | ||
|
||
export async function assertThrowsAbortError(cb: () => Promise<any>): Promise<void> { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)
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) |
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.
You absolutely can check into the repo before the review, you just can't release a beta package. |
@jeff Fisher Thanks for pointing that out. Do you mean we can't release a beta package as public preview after code check in? 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) |
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 |
Closing this PR as it has been superseded by #12713 |
No description provided.