Skip to content

Commit

Permalink
fix rebase errors
Browse files Browse the repository at this point in the history
Signed-off-by: abbyhu2000 <[email protected]>
  • Loading branch information
abbyhu2000 committed Aug 19, 2024
1 parent 49c3110 commit 21604e8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 18 deletions.
1 change: 0 additions & 1 deletion src/plugins/data/public/query/query_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import { TimefilterService, TimefilterSetup } from './timefilter';
import { createSavedQueryService } from './saved_query/saved_query_service';
import { createQueryStateObservable } from './state_sync/create_global_query_observable';
import { QueryStringManager, QueryStringContract } from './query_string';
import { DataSetContract, DataSetManager } from './dataset_manager';
import {
buildOpenSearchQuery,
DataStorage,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import { BehaviorSubject } from 'rxjs';
import { skip } from 'rxjs/operators';
import { CoreStart } from 'opensearch-dashboards/public';
import { DataStorage, Query, SimpleDataSet, TimeRange, UI_SETTINGS } from '../../../common';
import { Dataset, DataStorage, Query, TimeRange, UI_SETTINGS } from '../../../common';
import { createHistory, QueryHistory } from './query_history';
import { DatasetContract, DatasetManager } from './dataset_manager';

Expand Down Expand Up @@ -107,7 +107,7 @@ export class QueryStringManager {
};

// Todo: update this function to use the Query object when it is udpated, Query object should include time range and dataset
public addToQueryHistory(dataSet: SimpleDataSet, query: Query, timeRange?: TimeRange) {
public addToQueryHistory(dataSet: Dataset, query: Query, timeRange?: TimeRange) {
if (query.query) {
this.queryHistory.addQueryToHistory(dataSet, query, timeRange);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@ import { trimEnd } from 'lodash';
import { Observable, throwError } from 'rxjs';
import { i18n } from '@osd/i18n';
import { concatMap, map } from 'rxjs/operators';
import {
DATA_FRAME_TYPES,
getRawDataFrame,
getRawQueryString,
SIMPLE_DATA_SET_TYPES,
} from '../../../data/common';
import { DATA_FRAME_TYPES, getRawDataFrame, getRawQueryString } from '../../../data/common';
import {
DataPublicPluginStart,
IOpenSearchDashboardsSearchRequest,
Expand Down Expand Up @@ -66,10 +61,10 @@ export class SQLSearchInterceptor extends SearchInterceptor {
...dataFrame.meta,
queryConfig: {
...dataFrame.meta.queryConfig,
...(this.queryService.dataSetManager.getDataSet() && {
dataSourceId: this.queryService.dataSetManager.getDataSet()?.dataSourceRef?.id,
dataSourceName: this.queryService.dataSetManager.getDataSet()?.dataSourceRef?.name,
timeFieldName: this.queryService.dataSetManager.getDataSet()?.timeFieldName,
...(this.queryService.dataSetManager.getDataset() && {
dataSourceId: this.queryService.dataSetManager.getDataset()?.dataSource?.id,
dataSourceName: this.queryService.dataSetManager.getDataset()?.dataSource?.title,
timeFieldName: this.queryService.dataSetManager.getDataset()?.timeFieldName,
}),
},
};
Expand Down Expand Up @@ -109,10 +104,10 @@ export class SQLSearchInterceptor extends SearchInterceptor {
}

const queryString = getRawQueryString(searchRequest) ?? '';
const dataSourceRef = this.queryService.dataSetManager.getDataSet()
const dataSourceRef = this.queryService.dataSetManager.getDataset()
? {
dataSourceId: this.queryService.dataSetManager.getDataSet()?.dataSourceRef?.id,
dataSourceName: this.queryService.dataSetManager.getDataSet()?.dataSourceRef?.name,
dataSourceId: this.queryService.dataSetManager.getDataset()?.dataSource?.id,
dataSourceName: this.queryService.dataSetManager.getDataset()?.dataSource?.title,
}
: {};

Expand Down Expand Up @@ -187,8 +182,8 @@ export class SQLSearchInterceptor extends SearchInterceptor {
}

public search(request: IOpenSearchDashboardsSearchRequest, options: ISearchOptions) {
const dataSet = this.queryService.dataSetManager.getDataSet();
if (dataSet?.type === SIMPLE_DATA_SET_TYPES.TEMPORARY_ASYNC) {
const dataSet = this.queryService.dataSetManager.getDataset();
if (dataSet?.type === 'TEMPORARY_ASYNC') {
return this.runSearchAsync(request, options.abortSignal, SEARCH_STRATEGY.SQL_ASYNC);
}
return this.runSearch(request, options.abortSignal, SEARCH_STRATEGY.SQL);
Expand Down

0 comments on commit 21604e8

Please sign in to comment.