Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions optimizely/decision_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,8 @@ def get_variation(
}

# Check to see if user has a decision available for the given experiment
if user_profile_tracker is not None and not ignore_user_profile:
# Skip UPS for CMAB experiments as they require dynamic decisions
if user_profile_tracker is not None and not ignore_user_profile and not experiment.cmab:
variation = self.get_stored_variation(project_config, experiment, user_profile_tracker.get_user_profile())
if variation:
message = f'Returning previously activated variation ID "{variation}" of experiment ' \
Expand All @@ -472,6 +473,10 @@ def get_variation(
}
else:
self.logger.warning('User profile has invalid format.')
elif experiment.cmab:
message = f'Skipping User Profile Service for CMAB experiment "{experiment.key}".'
self.logger.debug(message)
decide_reasons.append(message)

# Check audience conditions
audience_conditions = experiment.get_audience_conditions_or_ids()
Expand Down Expand Up @@ -529,7 +534,8 @@ def get_variation(
self.logger.info(message)
decide_reasons.append(message)
# Store this new decision and return the variation for the user
if user_profile_tracker is not None and not ignore_user_profile:
# Skip UPS for CMAB experiments as they require dynamic decisions
if user_profile_tracker is not None and not ignore_user_profile and not experiment.cmab:
try:
user_profile_tracker.update_user_profile(experiment, variation)
except:
Expand Down
Loading