We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9b23e74 commit b0aec1aCopy full SHA for b0aec1a
2 files changed
flagsmith/models.py
@@ -30,14 +30,12 @@ def from_evaluation_result(
30
cls,
31
flag_result: SDKFlagResult,
32
) -> typing.Optional[Flag]:
33
- if (
34
- flagsmith_id := (flag_result.get("metadata") or {}).get("flagsmith_id")
35
- ) is not None:
+ if metadata := flag_result.get("metadata"):
36
return Flag(
37
enabled=flag_result["enabled"],
38
value=flag_result["value"],
39
feature_name=flag_result["name"],
40
- feature_id=flagsmith_id,
+ feature_id=metadata["flagsmith_id"],
41
)
42
return None
43
flagsmith/types.py
@@ -45,7 +45,7 @@ class SegmentMetadata(typing.TypedDict):
45
46
47
class FeatureMetadata(typing.TypedDict):
48
- flagsmith_id: NotRequired[int]
+ flagsmith_id: int
49
"""The ID of the feature used in Flagsmith API."""
50
51
0 commit comments