Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sqlmesh/lsp/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions sqlmesh/lsp/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion vscode/bus/src/callbacks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export type RPCMethods = {
}
api_query: {
params: {
endpoint: string
url: string
method: string
params: any
body: any
Expand Down
4 changes: 2 additions & 2 deletions vscode/extension/src/commands/tableDiff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion vscode/extension/src/lsp/custom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ interface AllModelsResponse extends BaseResponse {
}

export interface AbstractAPICallRequest {
endpoint: string
url: string
method: string
params: Record<string, any>
body: Record<string, any>
Expand Down
2 changes: 1 addition & 1 deletion vscode/react/src/api/instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export async function fetchAPI<T = any, B extends object = any>(
_options?: Partial<FetchOptionsWithSignal>,
): Promise<T & ResponseWithDetail> {
const request = {
endpoint: config.url,
url: config.url,
method: config.method,
params: config.params,
body: config.data,
Expand Down
2 changes: 1 addition & 1 deletion vscode/react/src/components/tablediff/RerunController.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: {},
})
Expand Down