Browse Source

Fix "instant selector vector" typo in error messages (#8800)

Signed-off-by: Julius Volz <julius.volz@gmail.com>
pull/8757/head
Julius Volz 4 years ago committed by GitHub
parent
commit
e313ffa8ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      promql/parser/parse.go
  2. 4
      promql/parser/parse_test.go

4
promql/parser/parse.go

@ -703,7 +703,7 @@ func (p *parser) addOffset(e Node, offset time.Duration) {
orgoffsetp = &s.OriginalOffset
endPosp = &s.EndPos
default:
p.addParseErrf(e.PositionRange(), "offset modifier must be preceded by an instant selector vector or range vector selector or a subquery")
p.addParseErrf(e.PositionRange(), "offset modifier must be preceded by an instant vector selector or range vector selector or a subquery")
return
}
@ -778,7 +778,7 @@ func (p *parser) getAtModifierVars(e Node) (**int64, *ItemType, *Pos, bool) {
timestampp = &s.Timestamp
endPosp = &s.EndPos
default:
p.addParseErrf(e.PositionRange(), "@ modifier must be preceded by an instant selector vector or range vector selector or a subquery")
p.addParseErrf(e.PositionRange(), "@ modifier must be preceded by an instant vector selector or range vector selector or a subquery")
return nil, nil, nil, false
}

4
promql/parser/parse_test.go

@ -528,7 +528,7 @@ var testExpr = []struct {
}, {
input: "1 offset 1d",
fail: true,
errMsg: "1:1: parse error: offset modifier must be preceded by an instant selector vector or range vector selector or a subquery",
errMsg: "1:1: parse error: offset modifier must be preceded by an instant vector selector or range vector selector or a subquery",
}, {
input: "foo offset 1s offset 2s",
fail: true,
@ -2270,7 +2270,7 @@ var testExpr = []struct {
}, {
input: `rate(some_metric[5m]) @ 1234`,
fail: true,
errMsg: "1:1: parse error: @ modifier must be preceded by an instant selector vector or range vector selector or a subquery",
errMsg: "1:1: parse error: @ modifier must be preceded by an instant vector selector or range vector selector or a subquery",
},
// Test function calls.
{

Loading…
Cancel
Save