From 6068787ee4e1b0f221013d6abbf782e4967f7679 Mon Sep 17 00:00:00 2001 From: Mike Date: Mon, 27 Jan 2025 16:10:06 +1300 Subject: [PATCH] Ignore rows with populated Error column (#220) --- CHANGELOG.md | 6 ++++++ requirements.txt | 6 +++--- src/hapi/pipelines/database/humanitarian_needs.py | 3 +++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad97f766..00dfec9f 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.35] = 2025-01-27 + +### Changed + +- Ignore any HNO rows with a populated Error column + ## [0.10.34] = 2025-01-23 ### Changed diff --git a/requirements.txt b/requirements.txt index b4f4c05a..eab5255b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ # uv pip compile pyproject.toml --resolver=backtracking --all-extras -o requirements.txt annotated-types==0.7.0 # via pydantic -attrs==24.3.0 +attrs==25.1.0 # via # frictionless # jsonlines @@ -156,7 +156,7 @@ pyasn1==0.6.1 # rsa pyasn1-modules==0.4.1 # via google-auth -pydantic==2.10.5 +pydantic==2.10.6 # via frictionless pydantic-core==2.27.2 # via pydantic @@ -196,7 +196,7 @@ quantulum3==0.9.2 # via hdx-python-api ratelimit==2.2.1 # via hdx-python-utilities -referencing==0.36.1 +referencing==0.36.2 # via # jsonschema # jsonschema-specifications diff --git a/src/hapi/pipelines/database/humanitarian_needs.py b/src/hapi/pipelines/database/humanitarian_needs.py index 8baeb56a..db1f79f2 100644 --- a/src/hapi/pipelines/database/humanitarian_needs.py +++ b/src/hapi/pipelines/database/humanitarian_needs.py @@ -50,6 +50,9 @@ def populate(self) -> None: max_admin_level = self._admins.get_max_admin_from_headers(headers) # Admin 1 PCode,Admin 2 PCode,Sector,Gender,Age Group,Disabled,Population Group,Population,In Need,Targeted,Affected,Reached for row in rows: + error = row.get("Error") + if error: + continue countryiso3 = row["Country ISO3"] if countryiso3 == "#country+code": # ignore HXL row continue