Skip to content

Commit

Permalink
Merge pull request #33 from OCHA-DAP/bugfix/3w-resource-ref
Browse files Browse the repository at this point in the history
Bugfix: resource ref
  • Loading branch information
turnerm authored Oct 2, 2023
2 parents 34bb05d + c0bedbf commit 54b5394
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/hapi/pipelines/app/pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
7 changes: 5 additions & 2 deletions src/hapi/pipelines/utilities/operational_presence.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"]
Expand Down

0 comments on commit 54b5394

Please sign in to comment.