SSE: Fix math expression to support NoData results (#61721)
* update perFloat to support NoData * update union to correctly handle no-data
This commit is contained in:
@@ -103,7 +103,13 @@ func Test_union(t *testing.T) {
|
||||
},
|
||||
},
|
||||
unionsAre: assert.EqualValues,
|
||||
unions: []*Union{},
|
||||
unions: []*Union{
|
||||
{
|
||||
Labels: nil,
|
||||
A: makeSeries("a", data.Labels{"id": "1"}),
|
||||
B: NewNoData(),
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "incompatible tags of different length with will result in no unions when len(A) != 1 && len(B) != 1",
|
||||
@@ -260,6 +266,30 @@ func Test_union(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "A is no-data and B is anything makes no-data",
|
||||
// Is this the behavior we want? A result within the results will no longer
|
||||
// be uniquely identifiable.
|
||||
aResults: Results{
|
||||
Values: Values{
|
||||
NewNoData(),
|
||||
},
|
||||
},
|
||||
bResults: Results{
|
||||
Values: Values{
|
||||
makeSeries("a", data.Labels{"id": "1"}),
|
||||
makeSeries("aa", data.Labels{"id": "1", "fish": "herring"}),
|
||||
},
|
||||
},
|
||||
unionsAre: assert.EqualValues,
|
||||
unions: []*Union{
|
||||
{
|
||||
Labels: nil,
|
||||
A: NewNoData(),
|
||||
B: makeSeries("a", data.Labels{"id": "1"}),
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user