Expression: Fix a bug of the display name of the threshold expression result (#85912)

* replace ReferenceVar with RefID when creating the math command for the ThresholdCommand

* Fix the Hysteresis test
This commit is contained in:
Faye Lin authored and GitHub committed 2024-04-12 17:46:14 +02:00
1 parent 10c6ab5a17
commit a94ab259c6
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -15,7 +15,7 @@ import (
func TestHysteresisExecute(t *testing.T) {
number := func(label string, value float64) mathexp.Number {
n := mathexp.NewNumber("A", data.Labels{"label": label})
n := mathexp.NewNumber("B", data.Labels{"label": label})
n.SetValue(&value)
return n
}
+1 -1
View File
@@ -120,7 +120,7 @@ func (tc *ThresholdCommand) Execute(ctx context.Context, now time.Time, vars mat
return mathexp.Results{}, err
}
mathCommand, err := NewMathCommand(tc.ReferenceVar, mathExpression)
mathCommand, err := NewMathCommand(tc.RefID, mathExpression)
if err != nil {
return mathexp.Results{}, err
}