TestData: multiple arrow requests should return multiple frames (#28417)

This commit is contained in:
Ryan McKinley 2020-10-21 08:53:49 -07:00 committed by GitHub
parent 29162a3aed
commit f32d47a535
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -198,7 +198,9 @@ function runArrowFile(target: TestDataQuery, req: DataQueryRequest<TestDataQuery
if (target.stringInput && target.stringInput.length > 10) {
try {
const table = base64StringToArrowTable(target.stringInput);
data = [arrowTableToDataFrame(table)];
const frame = arrowTableToDataFrame(table);
frame.refId = target.refId;
data = [frame];
} catch (e) {
console.warn('Error reading saved arrow', e);
const error = toDataQueryError(e);
@ -206,7 +208,7 @@ function runArrowFile(target: TestDataQuery, req: DataQueryRequest<TestDataQuery
return of({ state: LoadingState.Error, error, data });
}
}
return of({ state: LoadingState.Done, data });
return of({ state: LoadingState.Done, data, key: req.requestId + target.refId });
}
function runGrafanaAPI(target: TestDataQuery, req: DataQueryRequest<TestDataQuery>): Observable<DataQueryResponse> {