Make some Python API methods compatible with coming Mixer API changes.#116
Draft
mvashishtha wants to merge 1 commit intodatacommonsorg:masterfrom
Draft
Make some Python API methods compatible with coming Mixer API changes.#116mvashishtha wants to merge 1 commit intodatacommonsorg:masterfrom
mvashishtha wants to merge 1 commit intodatacommonsorg:masterfrom
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.
shifucun
reviewed
Feb 5, 2020
Contributor
shifucun
left a comment
There was a problem hiding this comment.
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([ |
Contributor
There was a problem hiding this comment.
might use a normal if else outside
| 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([ |
| 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([ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.