mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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:
@@ -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}
|
||||
}
|
||||
|
||||
|
||||
@@ -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": [
|
||||
|
||||
Reference in New Issue
Block a user