-
Notifications
You must be signed in to change notification settings - Fork 20
DELI-276 include historical refactor for get_descendant() #341
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
Conversation
groclient/lib.py
Outdated
@@ -675,20 +675,16 @@ def get_descendant(access_token, api_host, entity_type, entity_id, distance=None | |||
else: | |||
params['distance'] = -1 | |||
|
|||
if not include_historical: |
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.
minor: can simply use params['includeHistorical'] = include_historical
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.
good call, updating now.
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.
one minor comment, otherwise lgtm
waiting for the prod release |
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Previously get_descendant() made a call to
v2/regions/contains
to get the descendant ids for a given region, then if include_historical was set to false, it would do batch lookups of the descendant ids against thev2/regions
endpoint. After getting a response, it would filter the data for the regions that had include_historical set to false.This PR is directly related to the DELI-276 PR on the
gro/api
code base, where the includeHistorical parameter was added to the/v2/reginos/contains
endpoint as an optional parameter. Thus, now the filtering for the historical regions is done at the DB level, and unnecessary processing at the python API client is no longer necessary.