File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments