expr: add explicit strict-mode const (#94838)

expr: add explicit strict-mode value
This commit is contained in:
Gábor Farkas 2024-10-18 10:46:27 +02:00 committed by GitHub
parent 42016dc359
commit cbe1e7d63f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View File

@ -96,6 +96,9 @@ type ReduceSettings struct {
type ReduceMode string
const (
// Default mode
ReduceModeStrict = ""
// Drop non-numbers
ReduceModeDrop ReduceMode = "dropNN"

View File

@ -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{}