Skip to content

Commit

Permalink
Fix zipkin missing and number type column responses
Browse files Browse the repository at this point in the history
  • Loading branch information
pehrs committed Jan 30, 2024
1 parent 984d2da commit 6df676f
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion client/src/YqlResultsPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 += `<td><a href="${value}">${value}</a></td>`;
} else {
result += `<td>${value}</td>`;
Expand Down
4 changes: 2 additions & 2 deletions client/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ async function runYqlQuery(context: ExtensionContext, yql: string): Promise<void
response.json()
.then((data: any) => {
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);
Expand All @@ -545,7 +545,7 @@ async function runYqlQuery(context: ExtensionContext, yql: string): Promise<void
YqlResultsPanel.createOrShow(context.extensionUri, yql, data, undefined, queryTimestamp);
}
}).catch(reason => {
showError(`Could not parse response from ${queryEndpoint}, ${reason}`);
showError(`runYqlQuery(): Could not parse response from ${queryEndpoint}, ${reason}`);
});
})
.catch(reason => {
Expand Down
18 changes: 18 additions & 0 deletions client/testFixture/news-query.yql
Original file line number Diff line number Diff line change
@@ -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
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down

0 comments on commit 6df676f

Please sign in to comment.