From 6df676f25622e5f8dc2c9ec5c3d513d59de10e57 Mon Sep 17 00:00:00 2001 From: Matti Pehrs Date: Tue, 30 Jan 2024 09:51:38 +0100 Subject: [PATCH] Fix zipkin missing and number type column responses --- CHANGELOG.md | 5 +++++ client/package.json | 2 +- client/src/YqlResultsPanel.ts | 2 +- client/src/extension.ts | 4 ++-- client/testFixture/news-query.yql | 18 ++++++++++++++++++ package.json | 2 +- server/package.json | 2 +- 7 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 client/testFixture/news-query.yql diff --git a/CHANGELOG.md b/CHANGELOG.md index aff214b..246be0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to the "vscode-vespa" extension will be documented in this file. +## [1.1.4] + +- Make sure you can run query if zipkin is NOT defined. +- Fix bug with number type columns. + ## [1.1.3] - Fix issues with connecting to single node cluster at Vespa cluster startup and deployment. diff --git a/client/package.json b/client/package.json index 1147fb7..74ab72a 100644 --- a/client/package.json +++ b/client/package.json @@ -3,7 +3,7 @@ "description": "VSCode part of a language server", "author": "Matti Pehrs", "license": "MIT", - "version": "1.1.3", + "version": "1.1.4", "publisher": "pehrs.com", "engines": { "vscode": "^1.75.0" diff --git a/client/src/YqlResultsPanel.ts b/client/src/YqlResultsPanel.ts index 61e431c..cf69503 100644 --- a/client/src/YqlResultsPanel.ts +++ b/client/src/YqlResultsPanel.ts @@ -182,7 +182,7 @@ export class YqlResultsPanel { for (const column in fieldNames) { if (column in child.fields) { const value: string = child.fields[column]; - if (value.startsWith("http")) { + if (value !== undefined && typeof value === 'string' && value.startsWith("http")) { result += `${value}`; } else { result += `${value}`; diff --git a/client/src/extension.ts b/client/src/extension.ts index 84f76e6..c0a72d7 100644 --- a/client/src/extension.ts +++ b/client/src/extension.ts @@ -533,7 +533,7 @@ async function runYqlQuery(context: ExtensionContext, yql: string): Promise { outputChannel.appendLine("Got Vespa query response!"); - if (data.trace) { + if (data.trace && vespaConfig.zipkinEndpoint !== undefined && vespaConfig.zipkinEndpoint.length > 0) { uploadTrace2Zipkin(data) .then((zipkinLink: string) => { YqlResultsPanel.createOrShow(context.extensionUri, yql, data, zipkinLink, queryTimestamp); @@ -545,7 +545,7 @@ async function runYqlQuery(context: ExtensionContext, yql: string): Promise { - showError(`Could not parse response from ${queryEndpoint}, ${reason}`); + showError(`runYqlQuery(): Could not parse response from ${queryEndpoint}, ${reason}`); }); }) .catch(reason => { diff --git a/client/testFixture/news-query.yql b/client/testFixture/news-query.yql new file mode 100644 index 0000000..c35d89c --- /dev/null +++ b/client/testFixture/news-query.yql @@ -0,0 +1,18 @@ +{ + "yql": "select * from news where true", + "offset": 5, + "ranking": { + "matchPhase": { + "ascending": true, + "maxHits": 15 + } + }, + "presentation" : { + "bolding": false, + "format": "json" + }, + "trace": { + "level": 5, + "timestamps": true + } +} \ No newline at end of file diff --git a/package.json b/package.json index c4cf28c..2b0f3cb 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "vscode-vespa", "displayName": "vscode-vespa", "description": "Vespa AI Extension", - "version": "1.1.3", + "version": "1.1.4", "publisher": "pehrs-com", "license": "SEE LICENSE IN LICENSE", "icon": "media/vespa.png", diff --git a/server/package.json b/server/package.json index e24e9cf..b279dec 100644 --- a/server/package.json +++ b/server/package.json @@ -1,7 +1,7 @@ { "name": "vscode-vespa-server", "description": "Example implementation of a language server in node.", - "version": "1.1.3", + "version": "1.1.4", "author": "Matti Pehrs", "license": "MIT", "engines": {