Skip to content

Commit 06ce8db

Browse files
committed
nicer naming
1 parent 39df3cc commit 06ce8db

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

flag_engine/context/types.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,19 @@ class IdentityContext(TypedDict):
2727
traits: NotRequired[Dict[str, Optional[Union[str, float, bool]]]]
2828

2929

30-
class SegmentCondition1(TypedDict):
30+
class StrValueSegmentCondition(TypedDict):
3131
property: str
3232
operator: ConditionOperator
3333
value: str
3434

3535

36-
class SegmentCondition2(TypedDict):
36+
class InOperatorSegmentCondition(TypedDict):
3737
property: str
3838
operator: Literal["IN"]
3939
value: List[str]
4040

4141

42-
SegmentCondition = Union[SegmentCondition1, SegmentCondition2]
42+
SegmentCondition = Union[StrValueSegmentCondition, InOperatorSegmentCondition]
4343

4444

4545
class SegmentRule(TypedDict):

flag_engine/segments/evaluator.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
EvaluationContext,
1515
FeatureContext,
1616
SegmentCondition,
17+
SegmentContext,
18+
SegmentRule,
19+
StrValueSegmentCondition,
1720
)
18-
from flag_engine.context.types import SegmentCondition1 as StrValueSegmentCondition
19-
from flag_engine.context.types import SegmentContext, SegmentRule
2021
from flag_engine.environments.models import EnvironmentModel
2122
from flag_engine.identities.models import IdentityModel
2223
from flag_engine.identities.traits.types import ContextValue, is_trait_value

tests/unit/segments/test_segments_evaluator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
EvaluationContext,
1111
FeatureContext,
1212
SegmentCondition,
13+
SegmentContext,
14+
StrValueSegmentCondition,
1315
)
14-
from flag_engine.context.types import SegmentCondition1 as StrValueSegmentCondition
15-
from flag_engine.context.types import SegmentContext
1616
from flag_engine.environments.models import EnvironmentModel
1717
from flag_engine.features.models import FeatureModel, FeatureStateModel
1818
from flag_engine.identities.models import IdentityModel

0 commit comments

Comments
 (0)