-
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.
- Loading branch information
Showing
13 changed files
with
58,138 additions
and
153 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 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"], | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
"""Functions specific to the returnees theme.""" | ||
|
||
from logging import getLogger | ||
from typing import Dict | ||
|
||
from hapi_schema.db_returnees import DBReturnees | ||
|
||
from .hapi_dataset_uploader import HapiDatasetUploader | ||
|
||
logger = getLogger(__name__) | ||
|
||
|
||
class Returnees(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( | ||
"returnees", | ||
DBReturnees, | ||
max_admin_level=0, | ||
location_headers=["origin_location_code", "asylum_location_code"], | ||
) |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.