Commit 97e2837d by Ryan McKinley Committed by GitHub

Transformers: fix binary operation (#24604)

* check the display name

* remove unchanged line

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
parent f23ecc40
...@@ -10,6 +10,7 @@ import { seriesToColumnsTransformer } from './seriesToColumns'; ...@@ -10,6 +10,7 @@ import { seriesToColumnsTransformer } from './seriesToColumns';
import { getTimeField } from '../../dataframe/processDataFrame'; import { getTimeField } from '../../dataframe/processDataFrame';
import defaults from 'lodash/defaults'; import defaults from 'lodash/defaults';
import { BinaryOperationID, binaryOperators } from '../../utils/binaryOperators'; import { BinaryOperationID, binaryOperators } from '../../utils/binaryOperators';
import { getFieldDisplayName } from '../../field';
export enum CalculateFieldMode { export enum CalculateFieldMode {
ReduceRow = 'reduceRow', ReduceRow = 'reduceRow',
...@@ -182,7 +183,7 @@ function findFieldValuesWithNameOrConstant(frame: DataFrame, name: string): Vect ...@@ -182,7 +183,7 @@ function findFieldValuesWithNameOrConstant(frame: DataFrame, name: string): Vect
} }
for (const f of frame.fields) { for (const f of frame.fields) {
if (f.name === name) { if (name === getFieldDisplayName(f, frame)) {
return f.values; return f.values;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment