Skip to content

Commit 1cd6aab

Browse files
Remove redundant update function. Ad
d period to comment
1 parent 2504f98 commit 1cd6aab

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

optimizely/optimizely_config.py

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -200,18 +200,6 @@ def __init__(self, project_config):
200200

201201
self.audiences = optly_typed_audiences
202202

203-
def update_experiment(self, experiment, conditions, audiences_map):
204-
'''
205-
Gets an OptimizelyExperiment to update, conditions from
206-
the corresponding entities.Experiment and an audiences_map
207-
in the form of [id:name]
208-
209-
Updates the OptimizelyExperiment.audiences with a string
210-
of conditions and audience names.
211-
'''
212-
audiences = self.replace_ids_with_names(conditions, audiences_map)
213-
experiment.audiences = audiences
214-
215203
def replace_ids_with_names(self, conditions, audiences_map):
216204
'''
217205
Gets conditions and audiences_map [id:name]
@@ -232,7 +220,7 @@ def lookup_name_from_id(self, audience_id, audiences_map):
232220
233221
Returns:
234222
The name corresponding to the ID
235-
or None if not found
223+
or None if not found.
236224
'''
237225
name = ""
238226
try:
@@ -435,7 +423,8 @@ def _get_experiments_maps(self):
435423
exp['id'], exp['key'], self._get_variations_map(exp)
436424
)
437425
# Updating each OptimizelyExperiment
438-
self.update_experiment(optly_exp, exp.get('audienceConditions', []), audiences_map)
426+
audiences = self.replace_ids_with_names(exp.get('audienceConditions', []), audiences_map)
427+
optly_exp.audiences = audiences
439428

440429
experiments_key_map[exp['key']] = optly_exp
441430
experiments_id_map[exp['id']] = optly_exp
@@ -473,7 +462,7 @@ def _get_delivery_rules(self, rollouts):
473462
""" Gets an array of rollouts for the project config
474463
475464
returns:
476-
an array of OptimizelyExperiments as delivery rules
465+
an array of OptimizelyExperiments as delivery rules.
477466
"""
478467
# Return list for delivery rules
479468
delivery_rules = []

0 commit comments

Comments
 (0)