-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #231 from OCHA-DAP/HDXDSYS-1310-hapi-refugees-retu…
…rnees HDXDSYS-1310 HAPI refugees returnees
- Loading branch information
Showing
20 changed files
with
70,336 additions
and
242,139 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
"""Functions specific to the refugees theme.""" | ||
|
||
from logging import getLogger | ||
from typing import Dict | ||
|
||
from hapi_schema.db_refugees import DBRefugees | ||
|
||
from .hapi_dataset_uploader import HapiDatasetUploader | ||
|
||
logger = getLogger(__name__) | ||
|
||
|
||
class Refugees(HapiDatasetUploader): | ||
def populate_row(self, output_row: Dict, row: Dict) -> None: | ||
output_row["population_group"] = row["population_group"] | ||
output_row["gender"] = row["gender"] | ||
output_row["age_range"] = row["age_range"] | ||
output_row["min_age"] = row["min_age"] and int(row["min_age"]) | ||
output_row["max_age"] = row["max_age"] and int(row["max_age"]) | ||
output_row["population"] = row["population"] | ||
|
||
def populate(self) -> None: | ||
self.hapi_populate( | ||
"refugees", | ||
DBRefugees, | ||
end_resource=None, | ||
max_admin_level=0, | ||
location_headers=["origin_location_code", "asylum_location_code"], | ||
) |
Oops, something went wrong.