@@ -689,6 +689,10 @@ def get_bool(self, feature_name: str, default: bool = False) -> bool:
689
689
690
690
:return: the boolean value of the dyanimc config if it is active/exists, :code:`default` parameter otherwise.
691
691
"""
692
+ if self ._internal is None :
693
+ logger .error ("rs_decider is None--did not initialize." )
694
+ return default
695
+
692
696
return self ._get_dynamic_config_value (feature_name , default , bool , self ._internal .get_bool )
693
697
694
698
def get_int (self , feature_name : str , default : int = 0 ) -> int :
@@ -701,6 +705,10 @@ def get_int(self, feature_name: str, default: int = 0) -> int:
701
705
702
706
:return: the int value of the dyanimc config if it is active/exists, :code:`default` parameter otherwise.
703
707
"""
708
+ if self ._internal is None :
709
+ logger .error ("rs_decider is None--did not initialize." )
710
+ return default
711
+
704
712
return self ._get_dynamic_config_value (feature_name , default , int , self ._internal .get_int )
705
713
706
714
def get_float (self , feature_name : str , default : float = 0.0 ) -> float :
@@ -713,6 +721,10 @@ def get_float(self, feature_name: str, default: float = 0.0) -> float:
713
721
714
722
:return: the float value of the dyanimc config if it is active/exists, :code:`default` parameter otherwise.
715
723
"""
724
+ if self ._internal is None :
725
+ logger .error ("rs_decider is None--did not initialize." )
726
+ return default
727
+
716
728
return self ._get_dynamic_config_value (
717
729
feature_name , default , float , self ._internal .get_float
718
730
)
@@ -727,6 +739,10 @@ def get_string(self, feature_name: str, default: str = "") -> str:
727
739
728
740
:return: the string value of the dyanimc config if it is active/exists, :code:`default` parameter otherwise.
729
741
"""
742
+ if self ._internal is None :
743
+ logger .error ("rs_decider is None--did not initialize." )
744
+ return default
745
+
730
746
return self ._get_dynamic_config_value (feature_name , default , str , self ._internal .get_string )
731
747
732
748
def get_map (self , feature_name : str , default : Optional [dict ] = None ) -> Optional [dict ]:
@@ -739,6 +755,10 @@ def get_map(self, feature_name: str, default: Optional[dict] = None) -> Optional
739
755
740
756
:return: the map value of the dyanimc config if it is active/exists, :code:`default` parameter otherwise.
741
757
"""
758
+ if self ._internal is None :
759
+ logger .error ("rs_decider is None--did not initialize." )
760
+ return default
761
+
742
762
return self ._get_dynamic_config_value (feature_name , default , dict , self ._internal .get_map )
743
763
744
764
def get_all_dynamic_configs (self ) -> List [Dict [str , Any ]]:
@@ -830,10 +850,6 @@ def _get_dynamic_config_value(
830
850
dc_type : Type [T ],
831
851
get_fn : Callable [..., Type [T ]],
832
852
) -> T :
833
- if self ._internal is None :
834
- logger .error ("rs_decider is None--did not initialize." )
835
- return default
836
-
837
853
ctx = self ._decider_context .to_dict ()
838
854
839
855
try :
0 commit comments