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