Skip to content

Commit

Permalink
Merge branch 'main' into freeform_category2
Browse files Browse the repository at this point in the history
  • Loading branch information
mcarans authored Oct 15, 2024
2 parents 68d2337 + c2c8db6 commit d81d703
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 4 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Use freeform category for humanitarian needs
- Populate provider_admin1_name and provider_amdin2_name

## [0.10.10] - 2024-10-16

### Fixed

- Output error for blank appeal code

## [0.10.9] - 2024-10-15

### Added

- Lebanon operational presence

## [0.10.8] - 2024-10-10

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ckanapi==4.8
# via hdx-python-api
click==8.1.7
# via typer
coverage==7.6.2
coverage==7.6.3
# via pytest-cov
defopt==6.4.0
# via hdx-python-api
Expand Down
2 changes: 2 additions & 0 deletions src/hapi/pipelines/configs/core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ sector_map:
ame: "SHL"
ash: "WSH"
assainissement: "WSH"
basic assistance: "Hum"
camp coordination and camp management: "CCM"
camp coordination camp management: "CCM"
cash: "Cash"
Expand Down Expand Up @@ -456,6 +457,7 @@ sector_map:
services humanitaires communs: "Hum"
sexual and reproductive health: "HEA"
shelter: "SHL"
shelter & site coordination: "SHL"
shelter nfi: "SHL"
shelter nfis: "SHL"
shelter and nfi: "SHL"
Expand Down
33 changes: 33 additions & 0 deletions src/hapi/pipelines/configs/operational_presence.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ operational_presence_default:
- "operational_presence_gtm"
- "operational_presence_hnd"
- "operational_presence_hti"
- "operational_presence_lbn"
- "operational_presence_mli"
- "operational_presence_ner"
- "operational_presence_nga"
Expand Down Expand Up @@ -265,6 +266,38 @@ operational_presence_admintwo:
- "adm1Name"
- "adm2_Name"

operational_presence_lbn:
dataset: "lebanon-operational-presence"
resource: "lbn_sectorsreporting_bydistrict_20240902_hxlated.csv"
format: "csv"
headers: 1
source_date:
start: "01/07/2024"
end: "02/09/2024"
use_hxl: True
filter_cols:
- "#date+year"
- "#date+quarter"
prefilter: "#date+year=='2024' and #date+quarter=='Q3'"
admin:
- ~
- "#adm2+code"
admin_exact: True
input:
- "#org+name"
- "#org+acronym"
- "#org+type"
- "#sector+cluster+name"
- "#adm1+name"
- "#adm2+name"
list:
- "#org+name"
- "#org+acronym"
- "#org+type"
- "#sector+cluster+name"
- "#adm1+name"
- "#adm2+name"

operational_presence_mli:
dataset: "mali-operational-presence"
resource: "MALI_3W_June_2024"
Expand Down
14 changes: 11 additions & 3 deletions src/hapi/pipelines/database/funding.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,20 @@ def populate(self) -> None:
self._metadata.add_dataset(dataset)
self._metadata.add_resource(dataset_id, resource)
for row in rows:
appeal_code = row["#activity+appeal+id+external"]
appeal_name = row["#activity+appeal+name"]
appeal_type = row["#activity+appeal+type+name"]
requirements_usd = row["#value+funding+required+usd"]
if not requirements_usd:
continue
appeal_name = row["#activity+appeal+name"]
appeal_code = row["#activity+appeal+id+external"]
if appeal_code is None:
add_message(
errors,
dataset_name,
f"Blank appeal_code for {appeal_name}",
)
continue

appeal_type = row["#activity+appeal+type+name"]
funding_usd = row["#value+funding+total+usd"]
# This check for a missing funding line has been added due to
# an error in the UKR funding requirements data
Expand Down

0 comments on commit d81d703

Please sign in to comment.