Skip to content

Commit

Permalink
Enable filter for funding
Browse files Browse the repository at this point in the history
  • Loading branch information
b-j-mills committed Oct 14, 2024
1 parent 64fbc5e commit 550d924
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/hapi/pipelines/app/pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ def output_funding(self):
funding = Funding(
session=self.session,
metadata=self.metadata,
countryiso3s=self.countries,
locations=self.locations,
configuration=self.configuration,
)
Expand Down
5 changes: 5 additions & 0 deletions src/hapi/pipelines/database/funding.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Functions specific to the funding theme."""

from logging import getLogger
from typing import List

from hapi_schema.db_funding import DBFunding
from hdx.api.configuration import Configuration
Expand All @@ -21,11 +22,13 @@ def __init__(
self,
session: Session,
metadata: Metadata,
countryiso3s: List[str],
locations: locations,
configuration: Configuration,
):
super().__init__(session)
self._metadata = metadata
self._countryiso3s = countryiso3s
self._locations = locations
self._configuration = configuration

Expand All @@ -45,6 +48,8 @@ def populate(self) -> None:
if dataset["archived"]:
continue
admin_code = dataset.get_location_iso3s()[0]
if admin_code not in self._countryiso3s:
continue
resource = [
r
for r in dataset.get_resources()
Expand Down

0 comments on commit 550d924

Please sign in to comment.