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:
Kyle Brandt 2021-06-09 14:42:48 -04:00 committed by GitHub
parent 4b8d796c54
commit f4e9dcd40b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -15,7 +15,7 @@ func (cr classicReducer) ValidReduceFunc() bool {
switch cr {
case "avg", "sum", "min", "max", "count", "last", "median":
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 false

View File

@ -112,6 +112,7 @@ func TestReducer(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
require.Equal(t, true, tt.reducer.ValidReduceFunc())
num := tt.reducer.Reduce(tt.inputSeries)
require.Equal(t, tt.expectedNumber, num)
})