diff --git a/CHANGELOG.md b/CHANGELOG.md index 34c4494..2499285 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,17 @@ All notable changes to this project will be documented in this file. +## 2.9.10 + +- Bugfix: Account for template variable being a number +- Chore: update dependabot config (#317) +- Dependency updates: + - Upgrade grafana-plugin-sdk-go (deps): Bump github.com/grafana/grafana-plugin-sdk-go from 0.251.0 to 0.258.0 in [#314](https://github.com/grafana/timestream-datasource/pull/314),[#315](https://github.com/grafana/timestream-datasource/pull/315), [#319](https://github.com/grafana/timestream-datasource/pull/319) + - Updates github.com/aws/aws-sdk-go from 1.51.31 to 1.55.5 in [#319](https://github.com/grafana/timestream-datasource/pull/319) + - Updates github.com/grafana/grafana-aws-sdk from 0.31.2 to 0.31.3 in [#319](https://github.com/grafana/timestream-datasource/pull/319) + - Updates actions/checkout from 2 to 4 in [#318](https://github.com/grafana/timestream-datasource/pull/318) + - Updates tibdex/github-app-token from 1.8.0 to 2.1.0 in [#318](https://github.com/grafana/timestream-datasource/pull/318) + ## 2.9.9 - Fix "Wait for All Queries" toggle in [#313](https://github.com/grafana/timestream-datasource/pull/313) diff --git a/cspell.config.json b/cspell.config.json index defb852..ecd029d 100644 --- a/cspell.config.json +++ b/cspell.config.json @@ -95,6 +95,7 @@ "otelhttptrace", "otelgrpc", "sqlutil", - "errorsource" + "errorsource", + "tibdex" ] } diff --git a/package.json b/package.json index 1cb09aa..1f720c2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "grafana-timestream-datasource", - "version": "2.9.9", + "version": "2.9.10", "description": "Load data timestream in grafana", "scripts": { "build": "webpack -c ./.config/webpack/webpack.config.ts --env production", diff --git a/src/DataSource.test.ts b/src/DataSource.test.ts index 44a5740..ecfd975 100644 --- a/src/DataSource.test.ts +++ b/src/DataSource.test.ts @@ -46,7 +46,7 @@ describe('DataSource', () => { expect(res.rawQuery).toEqual(`select * from foo where var in ('foo','bar')`); }); - it('should replace __interval interpolated variables with their original string', () => { + it('should return number variables', () => { mockDatasource.applyTemplateVariables( { ...mockQuery, rawQuery: 'select $__interval_ms, $__interval' }, { @@ -55,8 +55,8 @@ describe('DataSource', () => { } ); // check rawQuery.replace is called with correct interval value - expect(replaceMock.mock.calls[3][1].__interval).toEqual({ value: '$__interval' }); - expect(replaceMock.mock.calls[3][1].__interval_ms).toEqual({ value: '$__interval_ms' }); + expect(replaceMock.mock.calls[3][1].__interval).toEqual({ value: 50000 }); + expect(replaceMock.mock.calls[3][1].__interval_ms).toEqual({ value: 5000000 }); }); }); }); diff --git a/src/DataSource.ts b/src/DataSource.ts index a82383c..6c8796c 100644 --- a/src/DataSource.ts +++ b/src/DataSource.ts @@ -55,11 +55,15 @@ export class DataSource extends DataSourceWithBackend { + private interpolateVariable = (value: string | string[] | number) => { if (typeof value === 'string') { return value; } + if (typeof value === 'number') { + return value; + } + const quotedValues = value.map((v) => { return this.quoteLiteral(v); }); @@ -76,14 +80,6 @@ export class DataSource extends DataSourceWithBackend