Skip to content

Commit

Permalink
comment addressed
Browse files Browse the repository at this point in the history
  • Loading branch information
ozayr-zaviar committed Dec 1, 2021
1 parent 981ab70 commit dcf0a48
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions optimizely/project_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,19 +121,19 @@ def __init__(self, datafile, logger, error_handler):
)

self.feature_key_map = self._generate_key_map(self.feature_flags, 'key', entities.FeatureFlag)
# As we cannot create json variables in datafile directly, here we convert
# the variables of string type and json subType to json type
# This is needed to fully support json variables
for feature in self.feature_key_map:
for variable in self.feature_key_map[feature].variables:
sub_type = variable.get('subType', '')
if variable['type'] == entities.Variable.Type.STRING and sub_type == entities.Variable.Type.JSON:
variable['type'] = entities.Variable.Type.JSON

# Dict containing map of experiment ID to feature ID.
# Dictionary containing dictionary of experiment ID to feature ID.
# for checking that experiment is a feature experiment or not.
self.experiment_feature_map = {}
for feature in self.feature_key_map.values():
# As we cannot create json variables in datafile directly, here we convert
# the variables of string type and json subType to json type
# This is needed to fully support json variables
for variable in self.feature_key_map[feature.key].variables:
sub_type = variable.get('subType', '')
if variable['type'] == entities.Variable.Type.STRING and sub_type == entities.Variable.Type.JSON:
variable['type'] = entities.Variable.Type.JSON

feature.variables = self._generate_key_map(feature.variables, 'key', entities.Variable)

rules = []
Expand Down

0 comments on commit dcf0a48

Please sign in to comment.