Skip to content

Commit 9ff6888

Browse files
Merge pull request #25 from OCHA-DAP/main
PR for merging hapi-pipelines into hapi-pipelines-prod
2 parents 09592c7 + 677fb56 commit 9ff6888

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

dump_views.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ echo "Started at $now"
55

66
mkdir -p database/csv
77

8-
views=$(docker exec -t postgres-container psql -t -U postgres -d hapi -c \
8+
views=$(docker exec -i postgres-container psql -t -U postgres -d hapi -c \
99
"select table_name from INFORMATION_SCHEMA.views WHERE table_schema = ANY (current_schemas(false))")
1010

1111
for view in $views

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ classifiers = [
3434
requires-python = ">=3.8"
3535

3636
dependencies = [
37-
"hapi-schema>=0.8.14",
37+
"hapi-schema>=0.8.15",
3838
"hdx-python-api>= 6.3.2",
3939
"hdx-python-country>= 3.7.7",
4040
"hdx-python-database[postgresql]>= 1.3.1",

requirements.txt

+6-6
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ click==8.1.7
2626
# via typer
2727
coverage==7.6.1
2828
# via pytest-cov
29-
cryptography==43.0.0
29+
cryptography==43.0.1
3030
# via pyopenssl
3131
defopt==6.4.0
3232
# via hdx-python-api
@@ -46,7 +46,7 @@ et-xmlfile==1.1.0
4646
# via openpyxl
4747
filelock==3.15.4
4848
# via virtualenv
49-
frictionless==5.17.0
49+
frictionless==5.17.1
5050
# via hdx-python-utilities
5151
google-auth==2.34.0
5252
# via
@@ -58,7 +58,7 @@ greenlet==3.0.3
5858
# via sqlalchemy
5959
gspread==6.1.2
6060
# via hdx-python-scraper
61-
hapi-schema==0.8.14
61+
hapi-schema==0.8.16
6262
# via hapi-pipelines (pyproject.toml)
6363
hdx-python-api==6.3.2
6464
# via
@@ -242,7 +242,7 @@ ruamel-yaml==0.18.6
242242
# via hdx-python-utilities
243243
ruamel-yaml-clib==0.2.8
244244
# via ruamel-yaml
245-
setuptools==74.0.0
245+
setuptools==74.1.1
246246
# via ckanapi
247247
shellingham==1.5.4
248248
# via typer
@@ -259,7 +259,7 @@ six==1.16.0
259259
# sphinxcontrib-napoleon
260260
sphinxcontrib-napoleon==0.7
261261
# via defopt
262-
sqlalchemy==2.0.32
262+
sqlalchemy==2.0.33
263263
# via
264264
# hapi-pipelines (pyproject.toml)
265265
# hapi-schema
@@ -295,7 +295,7 @@ urllib3==2.2.2
295295
# via
296296
# libhxl
297297
# requests
298-
validators==0.33.0
298+
validators==0.34.0
299299
# via frictionless
300300
virtualenv==20.26.3
301301
# via pre-commit

src/hapi/pipelines/database/poverty_rate.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Functions specific to the funding theme."""
22

33
from collections import defaultdict
4-
from datetime import date
4+
from datetime import datetime
55
from logging import getLogger
66
from typing import Dict
77

@@ -107,11 +107,11 @@ def populate(self) -> None:
107107
self._session.commit()
108108

109109

110-
def _convert_year_to_reference_period(year: str) -> [date, date]:
110+
def _convert_year_to_reference_period(year: str) -> [datetime, datetime]:
111111
# The year column can either be a single year or a range split by a dash.
112112
# This function turns this into a reference period start and end date.
113113
try:
114114
start_year, end_year = year.split("-")
115115
except ValueError:
116116
start_year, end_year = year, year
117-
return date(int(start_year), 1, 1), date(int(end_year), 12, 31)
117+
return datetime(int(start_year), 1, 1), datetime(int(end_year), 12, 31)

tests/test_main.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def pipelines(self, configuration, folder, themes_to_run):
116116
count = session.scalar(select(func.count(DBAdmin1.id)))
117117
check.equal(count, 703)
118118
count = session.scalar(select(func.count(DBAdmin2.id)))
119-
check.equal(count, 6160)
119+
check.equal(count, 5942)
120120
count = session.scalar(select(func.count(DBSector.code)))
121121
check.equal(count, 19)
122122
count = session.scalar(select(func.count(DBCurrency.code)))
@@ -257,6 +257,6 @@ def test_food_prices(self, configuration, folder, pipelines):
257257
count = session.scalar(select(func.count(DBWFPCommodity.code)))
258258
check.equal(count, 1077)
259259
count = session.scalar(select(func.count(DBWFPMarket.code)))
260-
check.equal(count, 4100)
260+
check.equal(count, 4040)
261261
count = session.scalar(select(func.count(DBFoodPrice.resource_hdx_id)))
262262
check.equal(count, 31615)

0 commit comments

Comments
 (0)