@@ -616,15 +616,18 @@ def _compare_numbers(self, custom_signal_key, target_value, actual_value, predic
616
616
result = - 1 if actual < target else 1 if actual > target else 0
617
617
return predicate_fn (result )
618
618
except ValueError :
619
- logger .warning ("Invalid numeric value for comparison for custom signal key %s." , custom_signal_key )
619
+ logger .warning ("Invalid numeric value for comparison for custom signal key %s." ,
620
+ custom_signal_key )
620
621
return False
621
622
622
- def _compare_semantic_versions (self , custom_signal_key , target_value , actual_value , predicate_fn ) -> bool :
623
+ def _compare_semantic_versions (self , custom_signal_key ,
624
+ target_value , actual_value , predicate_fn ) -> bool :
623
625
"""Compares the actual semantic version value of a signal against a target value.
624
626
Calls the predicate function with -1, 0, 1 if actual is less than, equal to,
625
627
or greater than target.
626
628
627
629
Args:
630
+ custom_signal_key: The custom singal for which the evaluation is being performed.
628
631
target_values: A list of target string values.
629
632
actual_value: The actual value to compare, which can be a string or number.
630
633
predicate_fn: A function that takes an integer (-1, 0, or 1) and returns a boolean.
@@ -636,10 +639,12 @@ def _compare_semantic_versions(self, custom_signal_key, target_value, actual_val
636
639
return self ._compare_versions (custom_signal_key , str (actual_value ),
637
640
str (target_value ), predicate_fn )
638
641
639
- def _compare_versions (self , custom_signal_key , sem_version_1 , sem_version_2 , predicate_fn ) -> bool :
642
+ def _compare_versions (self , custom_signal_key ,
643
+ sem_version_1 , sem_version_2 , predicate_fn ) -> bool :
640
644
"""Compares two semantic version strings.
641
645
642
646
Args:
647
+ custom_signal_key: The custom singal for which the evaluation is being performed.
643
648
sem_version_1: The first semantic version string.
644
649
sem_version_2: The second semantic version string.
645
650
predicate_fn: A function that takes an integer and returns a boolean.
@@ -663,7 +668,9 @@ def _compare_versions(self, custom_signal_key, sem_version_1, sem_version_2, pre
663
668
return predicate_fn (1 )
664
669
return predicate_fn (0 )
665
670
except ValueError :
666
- logger .warning ("Invalid semantic version format for comparison for custom signal key %s." , custom_signal_key )
671
+ logger .warning (
672
+ "Invalid semantic version format for comparison for custom signal key %s." ,
673
+ custom_signal_key )
667
674
return False
668
675
669
676
async def get_server_template (app : App = None , default_config : Optional [Dict [str , str ]] = None ):
0 commit comments