Skip to content

Commit

Permalink
Comment and test cleanups
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Volz <[email protected]>
  • Loading branch information
juliusv committed May 11, 2019
1 parent 7eb76b9 commit 18dfe0e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions promflux/aggregate_expr.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ func (t *transpiler) transpileAggregateExpr(a *promql.AggregateExpr) (ast.Expres
aggArgs := map[string]ast.Expression{}

if a.Op == promql.ItemTopK || a.Op == promql.ItemBottomK {
// TODO: Allow any constant scalars here.
// The PromQL parser already verifies that a.Param is a scalar.
n, ok := a.Param.(*promql.NumberLiteral)
if !ok {
Expand All @@ -90,6 +91,7 @@ func (t *transpiler) transpileAggregateExpr(a *promql.AggregateExpr) (ast.Expres
}

if a.Op == promql.ItemQuantile {
// TODO: Allow any constant scalars here.
// The PromQL already verifies that a.Param is a scalar.
n, ok := a.Param.(*promql.NumberLiteral)
if !ok {
Expand Down
3 changes: 1 addition & 2 deletions promflux/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,7 @@ var queries = []struct {

// Binary operators.
{
query: `1 * 2 + 4 / 6 - 10`,
variantArgs: []string{""},
query: `1 * 2 + 4 / 6 - 10`,
},
{
query: `demo_num_cpus + (1 {{.compBinOp}} bool 2)`,
Expand Down

0 comments on commit 18dfe0e

Please sign in to comment.