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:
Yuri Tseretyan
2023-01-20 09:53:03 -05:00
committed by GitHub
parent d0cf7ff8e9
commit c0913ce718
5 changed files with 141 additions and 1 deletions
+31 -1
View File
@@ -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) {