File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -153,13 +153,13 @@ def get_flag_result_from_feature_context(
153153 start_percentage = 0.0
154154
155155 for variant in variants :
156- limit = variant ["weight" ] + start_percentage
156+ limit = ( weight := variant ["weight" ]) + start_percentage
157157 if start_percentage <= percentage_value < limit :
158158 return {
159159 "enabled" : feature_context ["enabled" ],
160160 "feature_key" : feature_context ["feature_key" ],
161161 "name" : feature_context ["name" ],
162- "reason" : "SPLIT" ,
162+ "reason" : f "SPLIT; weight= { weight } " ,
163163 "value" : variant ["value" ],
164164 }
165165
Original file line number Diff line number Diff line change @@ -676,7 +676,7 @@ def test_get_evaluation_result__returns_expected(
676676 "enabled" : False ,
677677 "feature_key" : "1" ,
678678 "name" : "my_feature" ,
679- "reason" : "SPLIT" ,
679+ "reason" : "SPLIT; weight=30 " ,
680680 "value" : "foo" ,
681681 },
682682 ),
@@ -686,7 +686,7 @@ def test_get_evaluation_result__returns_expected(
686686 "enabled" : False ,
687687 "feature_key" : "1" ,
688688 "name" : "my_feature" ,
689- "reason" : "SPLIT" ,
689+ "reason" : "SPLIT; weight=30 " ,
690690 "value" : "bar" ,
691691 },
692692 ),
You can’t perform that action at this time.
0 commit comments