SSE: Fix NoData when some series were no data but others not (#45867)

Co-authored-by: Santiago <santiagohernandez.1997@gmail.com>
This commit is contained in:
Kyle Brandt
2022-02-24 21:01:04 -03:00
committed by GitHub
co-authored by Santiago
parent 8a98354844
commit a578cf0f7c
3 changed files with 33 additions and 2 deletions
+25
View File
@@ -169,6 +169,31 @@ func TestConditionsCmdExecute(t *testing.T) {
return v
},
},
{
name: "single query and single condition - empty series and not empty series",
vars: mathexp.Vars{
"A": mathexp.Results{
Values: []mathexp.Value{
valBasedSeries(),
valBasedSeries(ptr.Float64(3)),
},
},
},
conditionsCmd: &ConditionsCmd{
Conditions: []condition{
{
QueryRefID: "A",
Reducer: classicReducer("avg"),
Operator: "and",
Evaluator: &thresholdEvaluator{Type: "gt", Threshold: .5},
},
}},
resultNumber: func() mathexp.Number {
v := valBasedNumber(ptr.Float64(1))
v.SetMeta([]EvalMatch{{Value: ptr.Float64(3)}})
return v
},
},
{
name: "single query and two conditions",
vars: mathexp.Vars{