Skip to content

Commit b9661ed

Browse files
Fix(vscode): Use url instead of endpoint for for consistent API fields
1 parent 91428c7 commit b9661ed

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

sqlmesh/lsp/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class ApiRequest(CustomMethodRequestBaseClass):
2525
"""
2626

2727
requestId: str
28-
endpoint: str
28+
url: str
2929
method: t.Optional[str] = "GET"
3030
params: t.Optional[t.Dict[str, t.Any]] = None
3131
body: t.Optional[t.Dict[str, t.Any]] = None

sqlmesh/lsp/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ def _custom_api(
326326
ls.log_trace(f"API request: {request}")
327327
context = self._context_get_or_load()
328328

329-
parsed_url = urllib.parse.urlparse(request.endpoint)
329+
parsed_url = urllib.parse.urlparse(request.url)
330330
path_parts = parsed_url.path.strip("/").split("/")
331331

332332
if request.method == "GET":
@@ -423,7 +423,7 @@ def _custom_api(
423423
)
424424
return ApiResponseGetTableDiff(data=table_diff_result)
425425

426-
raise NotImplementedError(f"API request not implemented: {request.endpoint}")
426+
raise NotImplementedError(f"API request not implemented: {request.url}")
427427

428428
def _custom_supported_methods(
429429
self, ls: LanguageServer, params: SupportedMethodsRequest

vscode/bus/src/callbacks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export type RPCMethods = {
5151
}
5252
api_query: {
5353
params: {
54-
endpoint: string
54+
url: string
5555
method: string
5656
params: any
5757
body: any

vscode/extension/src/commands/tableDiff.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ export function showTableDiff(
206206

207207
return await lspClient.call_custom_method('sqlmesh/api', {
208208
method: 'GET',
209-
endpoint: '/api/table_diff',
209+
url: '/api/table_diff',
210210
params: {
211211
source: selectedSourceEnv.label,
212212
target: selectedTargetEnv.label,
@@ -484,7 +484,7 @@ export function showTableDiff(
484484

485485
return await lspClient.call_custom_method('sqlmesh/api', {
486486
method: 'GET',
487-
endpoint: '/api/table_diff',
487+
url: '/api/table_diff',
488488
params: {
489489
source: sourceEnvironment,
490490
target: targetEnvironment,

vscode/extension/src/lsp/custom.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ interface AllModelsResponse extends BaseResponse {
5050
}
5151

5252
export interface AbstractAPICallRequest {
53-
endpoint: string
53+
url: string
5454
method: string
5555
params: Record<string, any>
5656
body: Record<string, any>

vscode/react/src/api/instance.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export async function fetchAPI<T = any, B extends object = any>(
3939
_options?: Partial<FetchOptionsWithSignal>,
4040
): Promise<T & ResponseWithDetail> {
4141
const request = {
42-
endpoint: config.url,
42+
url: config.url,
4343
method: config.method,
4444
params: config.params,
4545
body: config.data,

vscode/react/src/components/tablediff/RerunController.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export function RerunController({
9393

9494
const apiPromise = callRpc('api_query', {
9595
method: 'GET',
96-
endpoint: '/api/table_diff',
96+
url: '/api/table_diff',
9797
params: params,
9898
body: {},
9999
})

0 commit comments

Comments
 (0)