DataFrame: expose an object array as a data frame (#23494)

This commit is contained in:
Ryan McKinley
2020-04-11 07:08:22 -07:00
committed by GitHub
parent 6cb7d95916
commit 6f1a25a896
12 changed files with 326 additions and 31 deletions

View File

@@ -646,7 +646,7 @@ export class LokiDatasource extends DataSourceApi<LokiQuery, LokiOptions> {
}
const view = new DataFrameView<{ ts: string; line: string }>(frame);
view.forEachRow(row => {
view.forEach(row => {
annotations.push({
time: new Date(row.ts).valueOf(),
text: row.line,

View File

@@ -420,7 +420,7 @@ export const enhanceDataFrame = (dataFrame: DataFrame, config: LokiOptions | nul
}, {} as Record<string, any>);
const view = new DataFrameView(dataFrame);
view.forEachRow((row: { line: string }) => {
view.forEach((row: { line: string }) => {
for (const field of derivedFields) {
const logMatch = row.line.match(field.matcherRegex);
fields[field.name].values.add(logMatch && logMatch[1]);