mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Refactor QueryRunner to remove type assertions (#42329)
This commit is contained in:
@@ -70,7 +70,7 @@ export class QueryRunner implements QueryRunnerSrv {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Add deprecated property
|
// Add deprecated property
|
||||||
(request as any).rangeRaw = timeRange.raw;
|
request.rangeRaw = timeRange.raw;
|
||||||
|
|
||||||
from(getDataSource(datasource, request.scopedVars))
|
from(getDataSource(datasource, request.scopedVars))
|
||||||
.pipe(first())
|
.pipe(first())
|
||||||
@@ -144,8 +144,9 @@ async function getDataSource(
|
|||||||
datasource: DataSourceRef | DataSourceApi | null,
|
datasource: DataSourceRef | DataSourceApi | null,
|
||||||
scopedVars: ScopedVars
|
scopedVars: ScopedVars
|
||||||
): Promise<DataSourceApi> {
|
): Promise<DataSourceApi> {
|
||||||
if (datasource && (datasource as any).query) {
|
if (datasource && 'query' in datasource) {
|
||||||
return datasource as DataSourceApi;
|
return datasource;
|
||||||
}
|
}
|
||||||
return await getDatasourceSrv().get(datasource, scopedVars);
|
|
||||||
|
return getDatasourceSrv().get(datasource, scopedVars);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user