Skip to content

Commit c01734a

Browse files
authored
Update HAPI pipelines to convert xlsx to csv before processing for conflict events (OCHA-DAP#140)
* Update HAPI pipelines to convert xlsx to csv before processing for conflict events * Update CHANGELOG
1 parent cac8198 commit c01734a

File tree

6 files changed

+16
-6
lines changed

6 files changed

+16
-6
lines changed

.config/pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repos:
88
- id: end-of-file-fixer
99
- id: check-ast
1010
- repo: https://github.com/astral-sh/ruff-pre-commit
11-
rev: v0.5.1
11+
rev: v0.5.5
1212
hooks:
1313
# Run the linter.
1414
- id: ruff
@@ -17,7 +17,7 @@ repos:
1717
- id: ruff-format
1818
args: [--config, .config/ruff.toml]
1919
- repo: https://github.com/astral-sh/uv-pre-commit
20-
rev: 0.2.13
20+
rev: 0.2.31
2121
hooks:
2222
# Run the pip compile
2323
- id: pip-compile

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66

7+
## [0.9.41] - 2024-07-31
8+
9+
### Changed
10+
11+
- Convert xlsx to csv for conflict events
12+
713
## [0.9.40] - 2024-07-30
814

915
### Changed

pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ dependencies = [
3838
"hdx-python-api>= 6.3.2",
3939
"hdx-python-country>= 3.7.7",
4040
"hdx-python-database[postgresql]>= 1.3.1",
41-
"hdx-python-scraper>= 2.4.0",
42-
"hdx-python-utilities>= 3.7.2",
41+
"hdx-python-scraper>= 2.4.1",
42+
"hdx-python-utilities>= 3.7.3",
4343
"libhxl",
4444
"sqlalchemy"
4545
]

requirements.txt

+4-2
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ hdx-python-country==3.7.7
7171
# hdx-python-scraper
7272
hdx-python-database==1.3.1
7373
# via hapi-pipelines (pyproject.toml)
74-
hdx-python-scraper==2.4.0
74+
hdx-python-scraper==2.4.1
7575
# via hapi-pipelines (pyproject.toml)
76-
hdx-python-utilities==3.7.2
76+
hdx-python-utilities==3.7.3
7777
# via
7878
# hapi-pipelines (pyproject.toml)
7979
# hdx-python-api
@@ -305,6 +305,8 @@ xlrd==2.0.1
305305
# via hdx-python-utilities
306306
xlrd3==1.1.0
307307
# via libhxl
308+
xlsx2csv==0.8.3
309+
# via hdx-python-utilities
308310
xlsxwriter==3.2.0
309311
# via tableschema-to-template
310312
xlwt==1.3.0

src/hapi/pipelines/configs/conflict_event.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ conflict_event_default:
8181
- "conflict_event_yem_civilian_targeting"
8282
- "conflict_event_yem_demonstration"
8383
format: "xlsx"
84+
xlsx2csv: True
8485
sheet: "Data"
8586
admin:
8687
- "ISO3"

src/hapi/pipelines/utilities/process_config_defaults.py

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ def _combine_default(country: Dict, default: Dict) -> Dict:
5656
country[list_name] = country[list_name] + default[list_name]
5757
for other_parameter in (
5858
"format",
59+
"xlsx2csv",
5960
"sheet",
6061
"headers",
6162
"use_hxl",

0 commit comments

Comments
 (0)