@@ -439,8 +439,8 @@ fn match_alert_operator(expr: &ConditionConfig) -> Expr {
439
439
// if it can be parsed as a number, then parse it
440
440
// else keep it as a string
441
441
if expr. value . as_ref ( ) . is_some_and ( |v| !v. is_empty ( ) ) {
442
- let value = expr. value . as_ref ( ) . unwrap ( ) ;
443
- let value = NumberOrString :: from_string ( value . clone ( ) ) ;
442
+ let string_value = expr. value . as_ref ( ) . unwrap ( ) ;
443
+ let value = NumberOrString :: from_string ( string_value . clone ( ) ) ;
444
444
445
445
// for maintaining column case
446
446
let column = format ! ( r#""{}""# , expr. column) ;
@@ -451,28 +451,28 @@ fn match_alert_operator(expr: &ConditionConfig) -> Expr {
451
451
WhereConfigOperator :: GreaterThan => col ( column) . gt ( lit ( value) ) ,
452
452
WhereConfigOperator :: LessThanOrEqual => col ( column) . lt_eq ( lit ( value) ) ,
453
453
WhereConfigOperator :: GreaterThanOrEqual => col ( column) . gt_eq ( lit ( value) ) ,
454
- WhereConfigOperator :: ILike => col ( column) . ilike ( lit ( value ) ) ,
455
- WhereConfigOperator :: Contains => col ( column) . like ( lit ( value ) ) ,
454
+ WhereConfigOperator :: ILike => col ( column) . ilike ( lit ( string_value ) ) ,
455
+ WhereConfigOperator :: Contains => col ( column) . like ( lit ( string_value ) ) ,
456
456
WhereConfigOperator :: BeginsWith => Expr :: BinaryExpr ( BinaryExpr :: new (
457
457
Box :: new ( col ( column) ) ,
458
458
Operator :: RegexIMatch ,
459
- Box :: new ( lit ( format ! ( "^{value }" ) ) ) ,
459
+ Box :: new ( lit ( format ! ( "^{string_value }" ) ) ) ,
460
460
) ) ,
461
461
WhereConfigOperator :: EndsWith => Expr :: BinaryExpr ( BinaryExpr :: new (
462
462
Box :: new ( col ( column) ) ,
463
463
Operator :: RegexIMatch ,
464
- Box :: new ( lit ( format ! ( "{value }$" ) ) ) ,
464
+ Box :: new ( lit ( format ! ( "{string_value }$" ) ) ) ,
465
465
) ) ,
466
- WhereConfigOperator :: DoesNotContain => col ( column) . not_ilike ( lit ( value ) ) ,
466
+ WhereConfigOperator :: DoesNotContain => col ( column) . not_ilike ( lit ( string_value ) ) ,
467
467
WhereConfigOperator :: DoesNotBeginWith => Expr :: BinaryExpr ( BinaryExpr :: new (
468
468
Box :: new ( col ( column) ) ,
469
469
Operator :: RegexNotIMatch ,
470
- Box :: new ( lit ( format ! ( "^{value }" ) ) ) ,
470
+ Box :: new ( lit ( format ! ( "^{string_value }" ) ) ) ,
471
471
) ) ,
472
472
WhereConfigOperator :: DoesNotEndWith => Expr :: BinaryExpr ( BinaryExpr :: new (
473
473
Box :: new ( col ( column) ) ,
474
474
Operator :: RegexNotIMatch ,
475
- Box :: new ( lit ( format ! ( "{value }$" ) ) ) ,
475
+ Box :: new ( lit ( format ! ( "{string_value }$" ) ) ) ,
476
476
) ) ,
477
477
_ => unreachable ! ( "value must not be null for operators other than `is null` and `is not null`. Should've been caught in validation" )
478
478
}
0 commit comments