Skip to content

Commit

Permalink
Output blank appeal codes instead of failing (#186)
Browse files Browse the repository at this point in the history
* Output blank appeal codes instead of failing

* Move requirements blank check to top
  • Loading branch information
mcarans authored Oct 15, 2024
1 parent 33ea08c commit c2c8db6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,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/).

## [0.10.9] - 2024-10-11
## [0.10.10] - 2024-10-16

### Fixed

- Output error for blank appeal code

## [0.10.9] - 2024-10-15

### Added

Expand Down
4 changes: 2 additions & 2 deletions 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 Expand Up @@ -95,7 +95,7 @@ jinja2==3.1.4
# via frictionless
jsonlines==4.0.0
# via hdx-python-utilities
jsonpath-ng==1.6.1
jsonpath-ng==1.7.0
# via libhxl
jsonschema==4.23.0
# via
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 c2c8db6

Please sign in to comment.