Skip to content

Commit ef423cf

Browse files
committed
add FeatureValue.priority
1 parent 789d737 commit ef423cf

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

flag_engine/context/types.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class EnvironmentContext(TypedDict):
2424
class FeatureValue(TypedDict):
2525
value: Any
2626
weight: float
27+
priority: int
2728

2829

2930
class IdentityContext(TypedDict):

tests/unit/segments/test_segments_evaluator.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -855,8 +855,8 @@ def test_get_flag_result_from_feature_context__calls_returns_expected(
855855
"name": "my_feature",
856856
"value": "control",
857857
"variants": [
858-
{"value": "foo", "weight": 30},
859-
{"value": "bar", "weight": 30},
858+
{"value": "foo", "weight": 30, "priority": 1},
859+
{"value": "bar", "weight": 30, "priority": 2},
860860
],
861861
}
862862

@@ -897,8 +897,8 @@ def test_get_flag_result_from_feature_context__null_key__calls_returns_expected(
897897
"name": "my_feature",
898898
"value": "control",
899899
"variants": [
900-
{"value": "foo", "weight": 30},
901-
{"value": "bar", "weight": 30},
900+
{"value": "foo", "weight": 30, "priority": 1},
901+
{"value": "bar", "weight": 30, "priority": 2},
902902
],
903903
}
904904

0 commit comments

Comments
 (0)