Skip to content

Commit 0c56c4d

Browse files
[AI-FSSDK] [FSSDK-12337] Update experiment type values to short-form abbreviations
1 parent 3a52b56 commit 0c56c4d

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

optimizely/helpers/enums.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -230,11 +230,11 @@ class OdpManagerConfig:
230230

231231

232232
class ExperimentTypes:
233-
ab: Final = 'a/b'
234-
mab: Final = 'multi_armed_bandit'
235-
cmab: Final = 'contextual_multi_armed_bandit'
236-
td: Final = 'targeted_delivery'
237-
fr: Final = 'feature_rollout'
233+
ab: Final = 'ab'
234+
mab: Final = 'mab'
235+
cmab: Final = 'cmab'
236+
td: Final = 'td'
237+
fr: Final = 'fr'
238238

239239

240240
class OdpSegmentsCacheConfig:

optimizely/helpers/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ class CmabDict(BaseEntity):
118118

119119

120120
ExperimentType = Literal[
121-
'a/b', 'multi_armed_bandit', 'contextual_multi_armed_bandit', 'targeted_delivery', 'feature_rollout'
121+
'ab', 'mab', 'cmab', 'td', 'fr'
122122
]
123123

124124
HoldoutStatus = Literal['Draft', 'Running', 'Concluded', 'Archived']

tests/test_config.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1580,7 +1580,7 @@ def test_experiment_type_field_parsed(self):
15801580
'audienceIds': [],
15811581
'trafficAllocation': [{'entityId': 'var_1', 'endOfRange': 5000}],
15821582
'variations': [{'key': 'var_1', 'id': 'var_1', 'featureEnabled': True}],
1583-
'type': 'feature_rollout',
1583+
'type': 'fr',
15841584
},
15851585
],
15861586
rollouts=[
@@ -1617,7 +1617,7 @@ def test_experiment_type_field_parsed(self):
16171617
config = opt.config_manager.get_config()
16181618

16191619
experiment = config.experiment_id_map['exp_1']
1620-
self.assertEqual(experiment.type, 'feature_rollout')
1620+
self.assertEqual(experiment.type, 'fr')
16211621

16221622
def test_experiment_type_field_none_when_missing(self):
16231623
"""Test that experiments without 'type' field have type=None."""
@@ -1666,7 +1666,7 @@ def test_feature_rollout_injects_everyone_else_variation(self):
16661666
'variations': [
16671667
{'key': 'rollout_var', 'id': 'rollout_var', 'featureEnabled': True}
16681668
],
1669-
'type': 'feature_rollout',
1669+
'type': 'fr',
16701670
},
16711671
],
16721672
rollouts=[
@@ -1750,7 +1750,7 @@ def test_feature_rollout_variation_maps_updated(self):
17501750
'variations': [
17511751
{'key': 'rollout_var', 'id': 'rollout_var', 'featureEnabled': True}
17521752
],
1753-
'type': 'feature_rollout',
1753+
'type': 'fr',
17541754
},
17551755
],
17561756
rollouts=[
@@ -1819,7 +1819,7 @@ def test_non_feature_rollout_experiments_unchanged(self):
18191819
'variations': [
18201820
{'key': 'var_1', 'id': 'var_1', 'featureEnabled': True}
18211821
],
1822-
'type': 'a/b',
1822+
'type': 'ab',
18231823
},
18241824
],
18251825
rollouts=[
@@ -1883,7 +1883,7 @@ def test_feature_rollout_with_no_rollout(self):
18831883
'variations': [
18841884
{'key': 'var_1', 'id': 'var_1', 'featureEnabled': True}
18851885
],
1886-
'type': 'feature_rollout',
1886+
'type': 'fr',
18871887
},
18881888
],
18891889
feature_flags=[

0 commit comments

Comments
 (0)