mirror of
https://github.com/grafana/grafana.git
synced 2024-11-22 08:56:43 -06:00
expr: add explicit strict-mode const (#94838)
expr: add explicit strict-mode value
This commit is contained in:
parent
42016dc359
commit
cbe1e7d63f
@ -96,6 +96,9 @@ type ReduceSettings struct {
|
||||
type ReduceMode string
|
||||
|
||||
const (
|
||||
// Default mode
|
||||
ReduceModeStrict = ""
|
||||
|
||||
// Drop non-numbers
|
||||
ReduceModeDrop ReduceMode = "dropNN"
|
||||
|
||||
|
@ -74,7 +74,7 @@ func (h *ExpressionQueryReader) ReadQuery(
|
||||
}
|
||||
if err == nil && q.Settings != nil {
|
||||
switch q.Settings.Mode {
|
||||
case "":
|
||||
case ReduceModeStrict:
|
||||
mapper = nil
|
||||
case ReduceModeDrop:
|
||||
mapper = mathexp.DropNonNumber{}
|
||||
|
Loading…
Reference in New Issue
Block a user