Skip to content

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

Merged
merged 6 commits into from
Mar 3, 2022

Conversation

yohn-dezmon
Copy link

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 the v2/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.

@yohn-dezmon yohn-dezmon requested a review from cn1036 February 15, 2022 16:58
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:
Copy link
Contributor

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good call, updating now.

Copy link
Contributor

@cn1036 cn1036 left a 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

@cn1036
Copy link
Contributor

cn1036 commented Feb 16, 2022

waiting for the prod release

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@muzigao-gro muzigao-gro merged commit 0ca7342 into development Mar 3, 2022
@muzigao-gro muzigao-gro deleted the DELI-276-include-historical-refactor branch March 3, 2022 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants