Skip to content

Commit b3fadb0

Browse files
authored
Merge pull request #48 from OCHA-DAP/main
HDXDSYS-1537 HAPI Pipelines - fix failure for empty reportingDate in IDPs data
2 parents 37f380e + e0ac801 commit b3fadb0

File tree

2 files changed

+29
-18
lines changed

2 files changed

+29
-18
lines changed

requirements.txt

+18-18
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,27 @@
22
# uv pip compile pyproject.toml --resolver=backtracking --all-extras -o requirements.txt
33
annotated-types==0.7.0
44
# via pydantic
5-
attrs==24.2.0
5+
attrs==24.3.0
66
# via
77
# frictionless
88
# jsonlines
99
# jsonschema
1010
# referencing
1111
cachetools==5.5.0
1212
# via google-auth
13-
certifi==2024.8.30
13+
certifi==2024.12.14
1414
# via requests
1515
cfgv==3.4.0
1616
# via pre-commit
1717
chardet==5.2.0
1818
# via frictionless
19-
charset-normalizer==3.4.0
19+
charset-normalizer==3.4.1
2020
# via requests
2121
ckanapi==4.8
2222
# via hdx-python-api
23-
click==8.1.7
23+
click==8.1.8
2424
# via typer
25-
coverage==7.6.9
25+
coverage==7.6.10
2626
# via pytest-cov
2727
defopt==6.4.0
2828
# via hdx-python-api
@@ -44,7 +44,7 @@ filelock==3.16.1
4444
# via virtualenv
4545
frictionless==5.18.0
4646
# via hdx-python-utilities
47-
google-auth==2.36.0
47+
google-auth==2.37.0
4848
# via
4949
# google-auth-oauthlib
5050
# gspread
@@ -77,21 +77,21 @@ hdx-python-utilities==3.7.4
7777
# hdx-python-scraper
7878
humanize==4.11.0
7979
# via frictionless
80-
identify==2.6.3
80+
identify==2.6.5
8181
# via pre-commit
8282
idna==3.10
8383
# via
8484
# email-validator
8585
# requests
8686
ijson==3.3.0
8787
# via hdx-python-utilities
88-
inflect==7.4.0
88+
inflect==7.5.0
8989
# via quantulum3
9090
iniconfig==2.0.0
9191
# via pytest
9292
isodate==0.7.2
9393
# via frictionless
94-
jinja2==3.1.4
94+
jinja2==3.1.5
9595
# via frictionless
9696
jsonlines==4.0.0
9797
# via hdx-python-utilities
@@ -124,7 +124,7 @@ more-itertools==10.5.0
124124
# via inflect
125125
nodeenv==1.9.1
126126
# via pre-commit
127-
num2words==0.5.13
127+
num2words==0.5.14
128128
# via quantulum3
129129
oauthlib==3.2.2
130130
# via requests-oauthlib
@@ -156,11 +156,11 @@ pyasn1==0.6.1
156156
# rsa
157157
pyasn1-modules==0.4.1
158158
# via google-auth
159-
pydantic==2.10.3
159+
pydantic==2.10.4
160160
# via frictionless
161-
pydantic-core==2.27.1
161+
pydantic-core==2.27.2
162162
# via pydantic
163-
pygments==2.18.0
163+
pygments==2.19.0
164164
# via rich
165165
pyphonetics==0.5.3
166166
# via hdx-python-country
@@ -224,19 +224,19 @@ rpds-py==0.22.3
224224
# referencing
225225
rsa==4.9
226226
# via google-auth
227-
ruamel-yaml==0.18.6
227+
ruamel-yaml==0.18.9
228228
# via hdx-python-utilities
229229
ruamel-yaml-clib==0.2.12
230230
# via ruamel-yaml
231-
setuptools==75.6.0
231+
setuptools==75.7.0
232232
# via ckanapi
233233
shellingham==1.5.4
234234
# via typer
235235
simpleeval==1.0.3
236236
# via frictionless
237237
simplejson==3.19.3
238238
# via ckanapi
239-
six==1.16.0
239+
six==1.17.0
240240
# via
241241
# ckanapi
242242
# pockets
@@ -278,13 +278,13 @@ unidecode==1.3.8
278278
# via
279279
# libhxl
280280
# pyphonetics
281-
urllib3==2.2.3
281+
urllib3==2.3.0
282282
# via
283283
# libhxl
284284
# requests
285285
validators==0.34.0
286286
# via frictionless
287-
virtualenv==20.28.0
287+
virtualenv==20.28.1
288288
# via pre-commit
289289
wheel==0.45.1
290290
# via libhxl

src/hapi/pipelines/database/idps.py

+11
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,17 @@ def populate(self) -> None:
7070
date_reported = row[hxl_tags.index("#date+reported")]
7171
reporting_round = row[hxl_tags.index("#round+code")]
7272
operation = row[hxl_tags.index("#operation+name")]
73+
# Ignore rows with no reporting date since it is part of
74+
# the primary key of DBIDPs
75+
if date_reported is None:
76+
text = (
77+
f"No reportingDate for admin code {admin_code}, assessment type {assessment_type}, "
78+
f"reporting round {reporting_round}, operation {operation}"
79+
)
80+
self._error_manager.add_message(
81+
"IDPs", dataset_name, text
82+
)
83+
continue
7384
duplicate_row_check = (
7485
admin2_ref,
7586
assessment_type,

0 commit comments

Comments
 (0)