~tomleb/promrule

a66fb05f136f2772d99c104db1cb2d7f264c3252 — Tom Lebreux 3 years ago 36e3e7c
Fix not grouping nested aggregates
1 files changed, 1 insertions(+), 0 deletions(-)

M grouper.go
M grouper.go => grouper.go +1 -0
@@ 27,6 27,7 @@ func (g Grouper) EnforceNode(node parser.Node) error {
	switch expr := node.(type) {
	case *parser.AggregateExpr:
		g.addGroupings(expr)
		return g.EnforceNode(expr.Expr)
	case *parser.BinaryExpr:
		if err := g.EnforceNode(expr.LHS); err != nil {
			return err