Skip to content
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

HDX-9863 Make range queries for datasets with the "population" variable #125

Merged
merged 6 commits into from
May 30, 2024

Conversation

IanHopkinson
Copy link
Collaborator

This PR adds population_min and population_max quaery parameters to the population, humanitarian needs and refugees endpoints. Changes are in files like:

  1. hdx_hapi/endpoints/get_population.py
  2. hdx_hapi/services/population_logic.py
  3. hdx_hapi/db/dao/population_view_dao.py

There are some minor, incidental changes in the documentation of the poverty-rate endpoint and also commenting out an instance of reference_period_start/end_min/max

if population_min:
query = query.where(HumanitarianNeedsView.population >= population_min)
if population_max:
query = query.where(HumanitarianNeedsView.population <= population_max)
Copy link
Contributor

Choose a reason for hiding this comment

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

it looks good, but I noticed that for other filters we are using < ..max instead of <=max

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OK - I changed this to < in the three places it occurs.

@danmihaila danmihaila merged commit 7692dd7 into dev May 30, 2024
2 checks passed
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