Skip to content

Commit

Permalink
remove temp filters on the runtime side
Browse files Browse the repository at this point in the history
  • Loading branch information
briangregoryholmes committed Dec 19, 2023
1 parent d02c021 commit 7653da8
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions runtime/queries/metricsview.go
Original file line number Diff line number Diff line change
Expand Up @@ -551,19 +551,25 @@ func convertFilterToExpression(filter *runtimev1.MetricsViewFilter) *runtimev1.E
if len(filter.Include) > 0 {
var includeExprs []*runtimev1.Expression
for _, cond := range filter.Include {
domExpr := convertDimensionFilterToExpression(cond, false)
if domExpr != nil {
includeExprs = append(includeExprs, domExpr)
if len(cond.In) > 0 {
domExpr := convertDimensionFilterToExpression(cond, false)
if domExpr != nil {
includeExprs = append(includeExprs, domExpr)
}
}
}
exprs = append(exprs, expressionpb.Or(includeExprs))
if len(includeExprs) > 0 {
exprs = append(exprs, expressionpb.Or(includeExprs))
}
}

if len(filter.Exclude) > 0 {
for _, cond := range filter.Exclude {
domExpr := convertDimensionFilterToExpression(cond, true)
if domExpr != nil {
exprs = append(exprs, domExpr)
if len(cond.In) > 0 {
domExpr := convertDimensionFilterToExpression(cond, true)
if domExpr != nil {
exprs = append(exprs, domExpr)
}
}
}
}
Expand All @@ -588,7 +594,7 @@ func convertDimensionFilterToExpression(cond *runtimev1.MetricsViewFilter_Cond,
} else {
inExpr = expressionpb.In(expressionpb.Identifier(cond.Name), inExprs)
}
}

Check failure on line 597 in runtime/queries/metricsview.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gci`-ed with --skip-generated -s standard -s default -s blank -s dot --custom-order (gci)

var likeExpr *runtimev1.Expression

Check failure on line 599 in runtime/queries/metricsview.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gci`-ed with --skip-generated -s standard -s default -s blank -s dot --custom-order (gci)
if len(cond.Like) == 1 {
Expand Down Expand Up @@ -625,6 +631,7 @@ func convertDimensionFilterToExpression(cond *runtimev1.MetricsViewFilter_Cond,
} else if likeExpr != nil {
return likeExpr
}
}

Check failure on line 634 in runtime/queries/metricsview.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gci`-ed with --skip-generated -s standard -s default -s blank -s dot --custom-order (gci)

return nil
}
Expand Down

0 comments on commit 7653da8

Please sign in to comment.