diff --git a/CHANGELOG.md b/CHANGELOG.md index 35325bde..92abe917 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,13 @@ All notable changes to this project will be documented in this file. -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). + +## [0.2.1] - 2023-10-02 + +### Fixed + +- Operational presence resource ref ## [0.2.0] - 2023-09-29 diff --git a/src/hapi/pipelines/app/pipelines.py b/src/hapi/pipelines/app/pipelines.py index ba7e63c3..e20b83e5 100644 --- a/src/hapi/pipelines/app/pipelines.py +++ b/src/hapi/pipelines/app/pipelines.py @@ -120,7 +120,7 @@ def output(self): self.sector.populate() # TODO: make this a single scraper once metadata issue is solved for scraper in self.operational_presence: - scraper.populate() + scraper.populate(metadata=self.metadata) self.gender.populate() results = self.runner.get_hapi_results() population = Population( diff --git a/src/hapi/pipelines/utilities/operational_presence.py b/src/hapi/pipelines/utilities/operational_presence.py index 6d6adf81..01afb6ca 100644 --- a/src/hapi/pipelines/utilities/operational_presence.py +++ b/src/hapi/pipelines/utilities/operational_presence.py @@ -11,6 +11,7 @@ get_admin1_to_location_connector_code, get_admin2_to_admin1_connector_code, ) +from hapi.pipelines.utilities.metadata import Metadata from hapi.pipelines.utilities.org import Org from hapi.pipelines.utilities.org_type import OrgType from hapi.pipelines.utilities.sector import Sector @@ -64,9 +65,11 @@ def add_sources(self): return # TODO: make this handle all countries once metadata issue is solved - def populate(self): + def populate(self, metadata: Metadata): logger.info("Populating operational presence table") - resource_ref = self.datasetinfo["hapi_resource_metadata"]["hdx_id"] + resource_ref = metadata.resource_data[ + self.datasetinfo["hapi_resource_metadata"]["hdx_id"] + ] reference_period_start = self.datasetinfo["hapi_dataset_metadata"][ "reference_period" ]["startdate"]