@@ -45,51 +45,61 @@ def resolve_boolean_details(
4545 self ,
4646 flag_key : str ,
4747 default_value : bool ,
48- context : EvaluationContext = EvaluationContext (),
48+ evaluation_context : EvaluationContext = EvaluationContext (),
4949 ) -> FlagResolutionDetails [bool ]:
50- return self ._resolve (flag_key , FlagType .BOOLEAN , default_value , context )
50+ return self ._resolve (
51+ flag_key , FlagType .BOOLEAN , default_value , evaluation_context
52+ )
5153
5254 def resolve_string_details (
5355 self ,
5456 flag_key : str ,
5557 default_value : str ,
56- context : EvaluationContext = EvaluationContext (),
58+ evaluation_context : EvaluationContext = EvaluationContext (),
5759 ) -> FlagResolutionDetails [str ]:
58- return self ._resolve (flag_key , FlagType .STRING , default_value , context )
60+ return self ._resolve (
61+ flag_key , FlagType .STRING , default_value , evaluation_context
62+ )
5963
6064 def resolve_integer_details (
6165 self ,
6266 flag_key : str ,
6367 default_value : int ,
64- context : EvaluationContext = EvaluationContext (),
68+ evaluation_context : EvaluationContext = EvaluationContext (),
6569 ) -> FlagResolutionDetails [int ]:
66- return self ._resolve (flag_key , FlagType .INTEGER , default_value , context )
70+ return self ._resolve (
71+ flag_key , FlagType .INTEGER , default_value , evaluation_context
72+ )
6773
6874 def resolve_float_details (
6975 self ,
7076 flag_key : str ,
7177 default_value : float ,
72- context : EvaluationContext = EvaluationContext (),
78+ evaluation_context : EvaluationContext = EvaluationContext (),
7379 ) -> FlagResolutionDetails [float ]:
74- return self ._resolve (flag_key , FlagType .FLOAT , default_value , context )
80+ return self ._resolve (
81+ flag_key , FlagType .FLOAT , default_value , evaluation_context
82+ )
7583
7684 def resolve_object_details (
7785 self ,
7886 flag_key : str ,
7987 default_value : typing .Union [dict , list ],
80- context : EvaluationContext = EvaluationContext (),
88+ evaluation_context : EvaluationContext = EvaluationContext (),
8189 ) -> FlagResolutionDetails [typing .Union [dict , list ]]:
82- return self ._resolve (flag_key , FlagType .OBJECT , default_value , context )
90+ return self ._resolve (
91+ flag_key , FlagType .OBJECT , default_value , evaluation_context
92+ )
8393
8494 def _resolve (
8595 self ,
8696 flag_key : str ,
8797 flag_type : FlagType ,
8898 default_value : typing .Any ,
89- context : EvaluationContext ,
99+ evaluation_context : EvaluationContext ,
90100 ) -> FlagResolutionDetails :
91101 try :
92- flag = self ._get_flags (context ).get_flag (flag_key )
102+ flag = self ._get_flags (evaluation_context ).get_flag (flag_key )
93103 except FlagsmithClientError as e :
94104 raise FlagsmithProviderError (
95105 error_code = ErrorCode .GENERAL ,
@@ -123,10 +133,10 @@ def _resolve(
123133 % (flag_key , flag_type .value )
124134 )
125135
126- def _get_flags (self , context : EvaluationContext = EvaluationContext ()):
127- if targeting_key := context .targeting_key :
136+ def _get_flags (self , evaluation_context : EvaluationContext = EvaluationContext ()):
137+ if targeting_key := evaluation_context .targeting_key :
128138 return self ._client .get_identity_flags (
129139 identifier = targeting_key ,
130- traits = context .attributes .get ("traits" , {}),
140+ traits = evaluation_context .attributes .get ("traits" , {}),
131141 )
132142 return self ._client .get_environment_flags ()
0 commit comments