From b9661ed6e083ceafd7a544b71672494625ab545a Mon Sep 17 00:00:00 2001 From: Themis Valtinos <73662635+themisvaltinos@users.noreply.github.com> Date: Wed, 27 Aug 2025 12:49:31 +0300 Subject: [PATCH] Fix(vscode): Use url instead of endpoint for for consistent API fields --- sqlmesh/lsp/api.py | 2 +- sqlmesh/lsp/main.py | 4 ++-- vscode/bus/src/callbacks.ts | 2 +- vscode/extension/src/commands/tableDiff.ts | 4 ++-- vscode/extension/src/lsp/custom.ts | 2 +- vscode/react/src/api/instance.ts | 2 +- vscode/react/src/components/tablediff/RerunController.tsx | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sqlmesh/lsp/api.py b/sqlmesh/lsp/api.py index 3135614d4b..882ca9825b 100644 --- a/sqlmesh/lsp/api.py +++ b/sqlmesh/lsp/api.py @@ -25,7 +25,7 @@ class ApiRequest(CustomMethodRequestBaseClass): """ requestId: str - endpoint: str + url: str method: t.Optional[str] = "GET" params: t.Optional[t.Dict[str, t.Any]] = None body: t.Optional[t.Dict[str, t.Any]] = None diff --git a/sqlmesh/lsp/main.py b/sqlmesh/lsp/main.py index 4d91dcc071..71dc5e1e2b 100755 --- a/sqlmesh/lsp/main.py +++ b/sqlmesh/lsp/main.py @@ -326,7 +326,7 @@ def _custom_api( ls.log_trace(f"API request: {request}") context = self._context_get_or_load() - parsed_url = urllib.parse.urlparse(request.endpoint) + parsed_url = urllib.parse.urlparse(request.url) path_parts = parsed_url.path.strip("/").split("/") if request.method == "GET": @@ -423,7 +423,7 @@ def _custom_api( ) return ApiResponseGetTableDiff(data=table_diff_result) - raise NotImplementedError(f"API request not implemented: {request.endpoint}") + raise NotImplementedError(f"API request not implemented: {request.url}") def _custom_supported_methods( self, ls: LanguageServer, params: SupportedMethodsRequest diff --git a/vscode/bus/src/callbacks.ts b/vscode/bus/src/callbacks.ts index 180ed0f330..0601fd892a 100644 --- a/vscode/bus/src/callbacks.ts +++ b/vscode/bus/src/callbacks.ts @@ -51,7 +51,7 @@ export type RPCMethods = { } api_query: { params: { - endpoint: string + url: string method: string params: any body: any diff --git a/vscode/extension/src/commands/tableDiff.ts b/vscode/extension/src/commands/tableDiff.ts index ac1a7a3069..d9587d261b 100644 --- a/vscode/extension/src/commands/tableDiff.ts +++ b/vscode/extension/src/commands/tableDiff.ts @@ -206,7 +206,7 @@ export function showTableDiff( return await lspClient.call_custom_method('sqlmesh/api', { method: 'GET', - endpoint: '/api/table_diff', + url: '/api/table_diff', params: { source: selectedSourceEnv.label, target: selectedTargetEnv.label, @@ -484,7 +484,7 @@ export function showTableDiff( return await lspClient.call_custom_method('sqlmesh/api', { method: 'GET', - endpoint: '/api/table_diff', + url: '/api/table_diff', params: { source: sourceEnvironment, target: targetEnvironment, diff --git a/vscode/extension/src/lsp/custom.ts b/vscode/extension/src/lsp/custom.ts index 152f316cdf..c8999d5b00 100644 --- a/vscode/extension/src/lsp/custom.ts +++ b/vscode/extension/src/lsp/custom.ts @@ -50,7 +50,7 @@ interface AllModelsResponse extends BaseResponse { } export interface AbstractAPICallRequest { - endpoint: string + url: string method: string params: Record body: Record diff --git a/vscode/react/src/api/instance.ts b/vscode/react/src/api/instance.ts index 781a98ef88..3627b273de 100644 --- a/vscode/react/src/api/instance.ts +++ b/vscode/react/src/api/instance.ts @@ -39,7 +39,7 @@ export async function fetchAPI( _options?: Partial, ): Promise { const request = { - endpoint: config.url, + url: config.url, method: config.method, params: config.params, body: config.data, diff --git a/vscode/react/src/components/tablediff/RerunController.tsx b/vscode/react/src/components/tablediff/RerunController.tsx index 6a609ecaaa..4d0e7885b2 100644 --- a/vscode/react/src/components/tablediff/RerunController.tsx +++ b/vscode/react/src/components/tablediff/RerunController.tsx @@ -93,7 +93,7 @@ export function RerunController({ const apiPromise = callRpc('api_query', { method: 'GET', - endpoint: '/api/table_diff', + url: '/api/table_diff', params: params, body: {}, })