Skip to content

Commit a3bce83

Browse files
replace constant endpoint with formatted string in fetch_decision method
1 parent afb4d50 commit a3bce83

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

optimizely/cmab/cmab_client.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919
from optimizely.helpers.enums import Errors
2020
from optimizely.exceptions import CmabFetchError, CmabInvalidResponseError
2121

22-
# CMAB_PREDICTION_ENDPOINT is the endpoint for CMAB predictions
23-
CMAB_PREDICTION_ENDPOINT = "https://prediction.cmab.optimizely.com/predict/%s"
24-
2522
# Default constants for CMAB requests
2623
DEFAULT_MAX_RETRIES = 3
2724
DEFAULT_INITIAL_BACKOFF = 0.1 # in seconds (100 ms)
@@ -87,7 +84,7 @@ def fetch_decision(
8784
Returns:
8885
str: The variation ID.
8986
"""
90-
url = CMAB_PREDICTION_ENDPOINT % rule_id
87+
url = f"https://prediction.cmab.optimizely.com/predict/{rule_id}"
9188
cmab_attributes = [
9289
{"id": key, "value": value, "type": "custom_attribute"}
9390
for key, value in attributes.items()

0 commit comments

Comments
 (0)