From b06662360eac373870220f53bc5425121b862a61 Mon Sep 17 00:00:00 2001 From: Mike Date: Wed, 16 Oct 2024 13:55:46 +1300 Subject: [PATCH] Trivial fix for humanitarian needs to handle invalid rows (#188) * Trivial fix * Update CHANGELOG.md --- CHANGELOG.md | 6 ++++++ src/hapi/pipelines/database/humanitarian_needs.py | 2 ++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 496f2dc..a584811 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ 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/). +## [0.10.12] - 2024-10-16 + +### Fixed + +- Error in handling admin2_ref in humanitarian needs + ## [0.10.11] - 2024-10-16 ### Changed diff --git a/src/hapi/pipelines/database/humanitarian_needs.py b/src/hapi/pipelines/database/humanitarian_needs.py index 2a9e130..88b789d 100644 --- a/src/hapi/pipelines/database/humanitarian_needs.py +++ b/src/hapi/pipelines/database/humanitarian_needs.py @@ -105,6 +105,8 @@ def populate(self) -> None: for row in rows: countryiso3 = row["Country ISO3"] admin2_ref = self.get_admin2_ref(row, dataset_name, errors) + if not admin2_ref: + continue provider_admin1_name = get_provider_name(row, "Admin 1 Name") provider_admin2_name = get_provider_name(row, "Admin 2 Name") sector = row["Sector"]