@@ -449,6 +449,7 @@ def parse_filter_string(filter_string: str) -> ModelFilter:
449
449
450
450
451
451
def _negate_boolean (boolean : BooleanValues ) -> BooleanValues :
452
+ """Negates boolean expression (False -> True, True -> False)."""
452
453
if boolean == BooleanValues .TRUE :
453
454
return BooleanValues .FALSE
454
455
if boolean == BooleanValues .FALSE :
@@ -460,6 +461,7 @@ def _evaluate_filter_expression_equals(
460
461
model_filter : ModelFilter ,
461
462
cached_model_value : Optional [Union [str , bool , int , float , Dict [str , Any ], List [Any ]]],
462
463
) -> BooleanValues :
464
+ """Evaluates filter expressions for equals."""
463
465
if cached_model_value is None :
464
466
return BooleanValues .FALSE
465
467
model_filter_value = model_filter .value
@@ -475,6 +477,7 @@ def _evaluate_filter_expression_in(
475
477
model_filter : ModelFilter ,
476
478
cached_model_value : Optional [Union [str , bool , int , float , Dict [str , Any ], List [Any ]]],
477
479
) -> BooleanValues :
480
+ """Evaluates filter expressions for string/list in."""
478
481
if cached_model_value is None :
479
482
return BooleanValues .FALSE
480
483
py_obj = model_filter .value
@@ -484,7 +487,7 @@ def _evaluate_filter_expression_in(
484
487
iter (py_obj )
485
488
except TypeError :
486
489
return BooleanValues .FALSE
487
- except Exception :
490
+ except Exception : # pylint: disable=W0703
488
491
pass
489
492
if isinstance (cached_model_value , list ):
490
493
return BooleanValues .FALSE
@@ -497,6 +500,7 @@ def _evaluate_filter_expression_includes(
497
500
model_filter : ModelFilter ,
498
501
cached_model_value : Optional [Union [str , bool , int , float , Dict [str , Any ], List [Any ]]],
499
502
) -> BooleanValues :
503
+ """Evaluates filter expressions for string includes."""
500
504
if cached_model_value is None :
501
505
return BooleanValues .FALSE
502
506
filter_value = str (model_filter .value )
@@ -509,6 +513,7 @@ def _evaluate_filter_expression_begins_with(
509
513
model_filter : ModelFilter ,
510
514
cached_model_value : Optional [Union [str , bool , int , float , Dict [str , Any ], List [Any ]]],
511
515
) -> BooleanValues :
516
+ """Evaluates filter expressions for string begins with."""
512
517
if cached_model_value is None :
513
518
return BooleanValues .FALSE
514
519
filter_value = str (model_filter .value )
@@ -521,6 +526,7 @@ def _evaluate_filter_expression_ends_with(
521
526
model_filter : ModelFilter ,
522
527
cached_model_value : Optional [Union [str , bool , int , float , Dict [str , Any ], List [Any ]]],
523
528
) -> BooleanValues :
529
+ """Evaluates filter expressions for string ends with."""
524
530
if cached_model_value is None :
525
531
return BooleanValues .FALSE
526
532
filter_value = str (model_filter .value )
0 commit comments