mirror of
https://github.com/grafana/grafana.git
synced 2024-11-25 18:30:41 -06:00
Alerting/SSE: Fix "count_non_null" reducer validation (#35451)
fixes error "reducer 'count_non_null' in condition 2 is not a valid reducer"
This commit is contained in:
parent
4b8d796c54
commit
f4e9dcd40b
@ -15,7 +15,7 @@ func (cr classicReducer) ValidReduceFunc() bool {
|
|||||||
switch cr {
|
switch cr {
|
||||||
case "avg", "sum", "min", "max", "count", "last", "median":
|
case "avg", "sum", "min", "max", "count", "last", "median":
|
||||||
return true
|
return true
|
||||||
case "diff", "diff_abs", "percent_diff", "percent_diff_abs", "count_not_null":
|
case "diff", "diff_abs", "percent_diff", "percent_diff_abs", "count_non_null":
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
@ -112,6 +112,7 @@ func TestReducer(t *testing.T) {
|
|||||||
|
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
|
require.Equal(t, true, tt.reducer.ValidReduceFunc())
|
||||||
num := tt.reducer.Reduce(tt.inputSeries)
|
num := tt.reducer.Reduce(tt.inputSeries)
|
||||||
require.Equal(t, tt.expectedNumber, num)
|
require.Equal(t, tt.expectedNumber, num)
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user