-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: change datafile accessor feature to return a string representation of datafile #283
Conversation
optimizely/project_config.py
Outdated
@@ -40,7 +40,7 @@ def __init__(self, datafile, logger, error_handler): | |||
""" | |||
|
|||
config = json.loads(datafile) | |||
self._datafile = datafile | |||
self._datafile = str(datafile) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You will have to specify encoding here if I understand correctly. It should be utf-8
.
Python 2 by default does ascii
and Python 3 does utf-8
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small change needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
optimizely/project_config.py
Outdated
@@ -40,7 +40,7 @@ def __init__(self, datafile, logger, error_handler): | |||
""" | |||
|
|||
config = json.loads(datafile) | |||
self._datafile = datafile | |||
self._datafile = str(datafile) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is per @mjc1283 's request. That's fine w me if we want to return a string. though SOhail prefers JSON, but Peter found a way to still return string and then convert it back to JSON in the FSC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Please wait for Ali's approval before merging.
…e array of the datafile
495f8da
to
6357c04
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be good now, but we should only merge when we have run against compatibility suite tests.
Reran FSC tests with datafile accessor flag and passed. Merging. |
Summary
string
type instead of previousbytes
typeTest Plan
Note
fullstack_prod_suite
because thebytes
datafile was not iterable, so I changed it to return astring