Skip to content

Commit ec19c3b

Browse files
mypy fix
1 parent fd7c723 commit ec19c3b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

optimizely/bucketer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
if version_info < (3, 8):
2323
from typing_extensions import Final
2424
else:
25-
from typing import Final # type: ignore
25+
from typing import Final, cast # type: ignore
2626

2727

2828
if TYPE_CHECKING:
@@ -193,8 +193,8 @@ def bucket_to_entity_id(
193193

194194
matched = False
195195
for allocation in group.trafficAllocation:
196-
end_of_range = allocation.get("endOfRange", 0)
197-
entity_id = allocation.get("entityId")
196+
end_of_range = cast(int, allocation.get("end_of_range", 0))
197+
entity_id = cast(Optional[str], allocation.get("entity_id"))
198198
if bucket_val < end_of_range:
199199
matched = True
200200
if entity_id != experiment.id:

0 commit comments

Comments
 (0)