Skip to content

Commit c505bc0

Browse files
committed
Fix FSC
1 parent e6ad886 commit c505bc0

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

optimizely/decision_service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -905,9 +905,9 @@ def get_variation_for_holdout(
905905
self.logger.info(message)
906906
decide_reasons.append(message)
907907

908-
# Create Decision for holdout - experiment is None, source is HOLDOUT
908+
# Create Decision for holdout - pass holdout dict as experiment, source is HOLDOUT
909909
holdout_decision: Decision = Decision(
910-
experiment=None,
910+
experiment=holdout, # type: ignore[arg-type]
911911
variation=variation,
912912
source=enums.DecisionSources.HOLDOUT,
913913
cmab_uuid=None

optimizely/optimizely.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1252,7 +1252,15 @@ def _create_optimizely_decision(
12521252

12531253
# Create Optimizely Decision Result.
12541254
attributes = user_context.get_user_attributes()
1255-
rule_key = flag_decision.experiment.key if flag_decision.experiment else None
1255+
# Handle both Experiment entities and holdout dicts
1256+
if flag_decision.experiment:
1257+
if isinstance(flag_decision.experiment, dict):
1258+
# Holdout is a dict, not an Experiment entity
1259+
rule_key = flag_decision.experiment.get('key')
1260+
else:
1261+
rule_key = flag_decision.experiment.key
1262+
else:
1263+
rule_key = None
12561264
all_variables = {}
12571265
decision_source = flag_decision.source
12581266
decision_event_dispatched = False

0 commit comments

Comments
 (0)