Skip to content

Commit

Permalink
Merge pull request #34 from OCHA-DAP/hno_deprecated
Browse files Browse the repository at this point in the history
Use deprecated HNO file and fix test
  • Loading branch information
alexandru-m-g authored Oct 14, 2024
2 parents 7e5ba48 + 6949dc7 commit e8e2bb9
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 9 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.6] - 2024-10-09

### Fixed

- Fix to use deprecated humanitarian needs resource temporarily

## [0.10.5] - 2024-10-08

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ classifiers = [
requires-python = ">=3.8"

dependencies = [
"hapi-schema>=0.8.17",
"hapi-schema==0.8.17",
"hdx-python-api>= 6.3.4",
"hdx-python-country>= 3.8.1",
"hdx-python-database[postgresql]>= 1.3.1",
Expand Down
9 changes: 4 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ inflect==7.4.0
# via quantulum3
iniconfig==2.0.0
# via pytest
isodate==0.6.1
isodate==0.7.2
# via frictionless
jinja2==3.1.4
# via frictionless
Expand All @@ -101,7 +101,7 @@ jsonschema==4.23.0
# via
# frictionless
# tableschema-to-template
jsonschema-specifications==2023.12.1
jsonschema-specifications==2024.10.1
# via jsonschema
libhxl==5.2.1
# via
Expand All @@ -116,7 +116,7 @@ markdown-it-py==3.0.0
# via rich
marko==2.1.2
# via frictionless
markupsafe==2.1.5
markupsafe==3.0.1
# via jinja2
mdurl==0.1.2
# via markdown-it-py
Expand Down Expand Up @@ -144,7 +144,7 @@ ply==3.11
# libhxl
pockets==0.9.1
# via sphinxcontrib-napoleon
pre-commit==4.0.0
pre-commit==4.0.1
# via hapi-pipelines (pyproject.toml)
psycopg==3.2.3
# via hdx-python-database
Expand Down Expand Up @@ -239,7 +239,6 @@ simplejson==3.19.3
six==1.16.0
# via
# ckanapi
# isodate
# pockets
# python-dateutil
# sphinxcontrib-napoleon
Expand Down
6 changes: 4 additions & 2 deletions src/hapi/pipelines/database/humanitarian_needs.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,15 @@ def populate(self) -> None:
self._metadata.add_dataset(dataset)
dataset_id = dataset["id"]
dataset_name = dataset["name"]
resource = dataset.get_resource() # assumes first resource is latest!
resource = dataset.get_resource(
1
) # assumes second resource is latest!
self._metadata.add_resource(dataset_id, resource)
negative_values_by_iso3 = {}
rounded_values_by_iso3 = {}
resource_id = resource["id"]
resource_name = resource["name"]
year = int(resource_name[-4:])
year = int(resource_name[-15:-11])
time_period_start = datetime(year, 1, 1)
time_period_end = datetime(year, 12, 31, 23, 59, 59)
url = resource["url"]
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/input/global-hpc-hno.json

Large diffs are not rendered by default.

0 comments on commit e8e2bb9

Please sign in to comment.