-
Notifications
You must be signed in to change notification settings - Fork 39
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
Make some Python API methods compatible with coming Mixer API changes. #116
base: master
Are you sure you want to change the base?
Conversation
We are going to change the places-in, population, and observation mixer API methods so that they return maps from dcid to lists of dcids, population dcids, and observation values respectively. Update the corresponding Python API methods so that they work with both the new and old Mixer API versions.
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.
Thanks for the change! looks much better now.
]) | ||
res_json =json.dumps({ | ||
'geoId/06085': 'dc/p/crgfn8blpvl35', | ||
'geoId/4805000': 'dc/p/f3q9whmjwbf36'}) if kwargs['new_mixer_api'] else json.dumps([ |
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.
might use a normal if else outside
@@ -103,7 +106,7 @@ def read(self): | |||
and data['measurement_method'] == 'BLSSeasonallyAdjusted': | |||
if data['dcids'] == ['dc/p/x6t44d8jd95rd', 'dc/p/lr52m1yr46r44', 'dc/p/fs929fynprzs']: | |||
# Response returned when querying for multiple valid dcids. | |||
res_json = json.dumps([ | |||
res_json = json.dumps({'dc/p/x6t44d8jd95rd': '18704962.000000', 'dc/p/lr52m1yr46r44': '3075662.000000', 'dc/p/fs929fynprzs': '1973955.000000'}) if kwargs['new_mixer_api'] else json.dumps([ |
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.
try to conform to line 80
@@ -120,7 +123,7 @@ def read(self): | |||
return MockResponse(json.dumps({'payload': res_json})) | |||
if data['dcids'] == ['dc/p/x6t44d8jd95rd', 'dc/MadDcid']: | |||
# Response returned when querying for a dcid that does not exist. | |||
res_json = json.dumps([ | |||
res_json = json.dumps({'dc/p/x6t44d8jd95rd' : '18704962.000000'}) if kwargs['new_mixer_api'] else json.dumps([ |
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.
same here
We are going to change the places-in, population, and observation mixer API methods
so that they return maps from dcid to lists of dcids, population dcids, and
observation values respectively. Update the corresponding Python API methods so
that they work with both the new and old Mixer API versions.