Skip to content

Commit 3f05ad8

Browse files
[AI-FSSDK] [FSSDK-12337] Remove ExperimentTypes class, simplify type check
- Remove redundant ExperimentTypes class from enums.py (ExperimentType Literal suffices) - Simplify getattr(experiment, 'type', None) to experiment.type
1 parent d95f1e8 commit 3f05ad8

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

optimizely/helpers/enums.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,6 @@ class DecisionSources:
102102
HOLDOUT: Final = 'holdout'
103103

104104

105-
class ExperimentTypes:
106-
AB: Final = 'a/b'
107-
MAB: Final = 'mab'
108-
CMAB: Final = 'cmab'
109-
FEATURE_ROLLOUT: Final = 'feature_rollout'
110-
111-
112105
class Errors:
113106
INVALID_ATTRIBUTE: Final = 'Provided attribute is not in datafile.'
114107
INVALID_ATTRIBUTE_FORMAT: Final = 'Attributes provided are in an invalid format.'

optimizely/project_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ def __init__(self, datafile: str | bytes, logger: Logger, error_handler: Any):
237237
everyone_else_variation = self._get_everyone_else_variation(feature)
238238
if everyone_else_variation is not None:
239239
for experiment in rules:
240-
if getattr(experiment, 'type', None) == enums.ExperimentTypes.FEATURE_ROLLOUT:
240+
if experiment.type == 'feature_rollout':
241241
experiment.variations.append(everyone_else_variation)
242242
experiment.trafficAllocation.append({
243243
'entityId': everyone_else_variation['id'],

0 commit comments

Comments
 (0)