[AI-FSSDK] (DO NOT REVIEW) [FSSDK-12265] Add experiments field to Holdout data model #486
+446
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements experiment-specific holdout targeting by adding an
experimentsfield to the Holdout data model. This enables holdouts to target specific experiments in addition to flags.Changes Made
Holdout Entity (
optimizely/entities.py):experiments: List[str]field with default empty listis_localproperty that returnsTruewhen experiments list is not emptyType Definitions (
optimizely/helpers/types.py):experiments: list[str]toHoldoutDictTypedDictProjectConfig (
optimizely/project_config.py):experiment_holdouts_map: Dict[str, List[Holdout]]for efficient experiment-to-holdout lookupsget_holdouts_for_experiment(experiment_id: str) -> List[Holdout]methodTests (
tests/test_config.py):experimentsfield defaults and populationis_localproperty behaviorget_holdouts_for_experimentfunctionalityImplementation Notes
is_localproperty helps identify experiment-specific holdoutsTest Results
```
✅ 97 tests passed in tests/test_config.py
✅ 48 tests passed in holdout-specific test files
```
Related
🤖 Generated with Claude Code