Expr: Make math expression scalars compliant with dataplane contract (#90350)

* Specify frame type for scalars arbitrarily

* Update alerting tests which assert on entire dataframe fields
This commit is contained in:
Alexander Weaver
2024-07-12 12:52:19 -05:00
committed by GitHub
parent e0416cc0f8
commit b3d863c11e
2 changed files with 19 additions and 4 deletions

View File

@@ -88,7 +88,10 @@ func (s Scalar) AsDataFrame() *data.Frame { return s.Frame }
func NewScalar(name string, f *float64) Scalar {
frame := data.NewFrame("",
data.NewField(name, nil, []*float64{f}),
)
).SetMeta(&data.FrameMeta{
Type: data.FrameTypeNumericMulti,
TypeVersion: data.FrameTypeVersion{0, 1},
})
return Scalar{frame}
}

View File

@@ -2419,7 +2419,11 @@ func TestIntegrationEval(t *testing.T) {
"nullable": true
}
}
]
],
"meta": {
"type": "numeric-multi",
"typeVersion": [0, 1]
}
},
"data": {
"values": [
@@ -2477,7 +2481,11 @@ func TestIntegrationEval(t *testing.T) {
"nullable": true
}
}
]
],
"meta": {
"type": "numeric-multi",
"typeVersion": [0, 1]
}
},
"data": {
"values": [
@@ -2568,7 +2576,11 @@ func TestIntegrationEval(t *testing.T) {
"nullable": true
}
}
]
],
"meta": {
"type": "numeric-multi",
"typeVersion": [0, 1]
}
},
"data": {
"values": [