We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd7c723 commit ec19c3bCopy full SHA for ec19c3b
optimizely/bucketer.py
@@ -22,7 +22,7 @@
22
if version_info < (3, 8):
23
from typing_extensions import Final
24
else:
25
- from typing import Final # type: ignore
+ from typing import Final, cast # type: ignore
26
27
28
if TYPE_CHECKING:
@@ -193,8 +193,8 @@ def bucket_to_entity_id(
193
194
matched = False
195
for allocation in group.trafficAllocation:
196
- end_of_range = allocation.get("endOfRange", 0)
197
- entity_id = allocation.get("entityId")
+ end_of_range = cast(int, allocation.get("end_of_range", 0))
+ entity_id = cast(Optional[str], allocation.get("entity_id"))
198
if bucket_val < end_of_range:
199
matched = True
200
if entity_id != experiment.id:
0 commit comments