Skip to content

Commit 55a9ada

Browse files
Supply data source version to Datasets (#10798)
* pass engine version from saved objects to the dataset datasourceref Signed-off-by: Paul Sebastian <[email protected]> * Changeset file for PR #10798 created/updated --------- Signed-off-by: Paul Sebastian <[email protected]> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
1 parent a2d096f commit 55a9ada

File tree

5 files changed

+10
-0
lines changed

5 files changed

+10
-0
lines changed

changelogs/fragments/10798.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
infra:
2+
- Supply data source version to Datasets ([#10798](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/10798))

src/plugins/data/common/data_views/data_views/data_view.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ export class DataView extends IndexPattern implements IDataView {
7777
this.dataSourceRef = {
7878
id: this.dataSourceRef.id,
7979
type: attributes.dataSourceEngineType || this.dataSourceRef.type,
80+
version: attributes.dataSourceVersion || this.dataSourceRef.version,
8081
name: attributes.title || this.dataSourceRef.name || this.dataSourceRef.id,
8182
};
8283
} catch (error) {
@@ -115,6 +116,7 @@ export class DataView extends IndexPattern implements IDataView {
115116
id: dataSourceReference.id,
116117
title: attributes.title || dataSourceReference.id,
117118
type: attributes.dataSourceEngineType || 'OpenSearch',
119+
version: attributes.dataSourceVersion || '',
118120
};
119121
} catch (error) {
120122
// If we can't fetch the data source, create a minimal version
@@ -125,6 +127,7 @@ export class DataView extends IndexPattern implements IDataView {
125127
? dataSourceReference.name
126128
: dataSourceReference.id,
127129
type: 'OpenSearch',
130+
version: '',
128131
};
129132
}
130133
}

src/plugins/data/common/datasets/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ export interface DataSource {
1616
title: string;
1717
/** The engine type of the data source */
1818
type: string;
19+
/** Version of the data source */
20+
version: string;
1921
/** Optional metadata for the data source */
2022
meta?: DataSourceMeta;
2123
}

src/plugins/data/common/index_patterns/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ export interface SavedObjectReference {
213213
name?: string;
214214
id: string;
215215
type: string;
216+
version: string;
216217
}
217218
export interface IndexPatternSpec {
218219
id?: string;

src/plugins/data/public/query/query_string/dataset_service/dataset_service.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ export class DatasetService {
120120
id: dataset.dataSource.id!,
121121
name: dataset.dataSource.title,
122122
type: dataset.dataSource.type,
123+
version: dataset.dataSource.version,
123124
}
124125
: undefined,
125126
} as IndexPatternSpec;
@@ -201,6 +202,7 @@ export class DatasetService {
201202
id: dataset.dataSource.id!,
202203
name: dataset.dataSource.title,
203204
type: dataset.dataSource.type,
205+
version: dataset.dataSource.version,
204206
}
205207
: undefined,
206208
} as IndexPatternSpec;

0 commit comments

Comments
 (0)