mirror of
https://github.com/grafana/grafana.git
synced 2025-07-30 21:53:00 +08:00
Alerting: Fix mathexp.NoData cannot be reduced (#55347)
This commit fixes a bug where queries from datasources such as InfluxDB that returned no data would not create a DatasourceNoData alert, but instead an error "can only reduce type series, got type noData".
This commit is contained in:
@ -171,6 +171,8 @@ func (gr *ReduceCommand) Execute(_ context.Context, vars mathexp.Vars) (mathexp.
|
||||
Text: fmt.Sprintf("Reduce operation is not needed. Input query or expression %s is already reduced data.", gr.VarToReduce),
|
||||
})
|
||||
newRes.Values = append(newRes.Values, copyV)
|
||||
case mathexp.NoData:
|
||||
newRes.Values = append(newRes.Values, v.New())
|
||||
default:
|
||||
return newRes, fmt.Errorf("can only reduce type series, got type %v", val.Type())
|
||||
}
|
||||
|
Reference in New Issue
Block a user