Skip to content

Commit

Permalink
Merge pull request #9 from OCHA-DAP/HAPI-244
Browse files Browse the repository at this point in the history
Change resource filename to name
  • Loading branch information
b-j-mills authored Oct 19, 2023
2 parents 5ed56e2 + 1ff699a commit 0752229
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,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/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.3.1]

### Changed

- Renamed resource column `filename` to `name`

## [0.3.0]

### Added
Expand Down
2 changes: 1 addition & 1 deletion src/hapi_schema/db_operational_presence.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class DBOperationalPresence(Base):
DBDataset.provider_code.label("dataset_provider_code"),
DBDataset.provider_name.label("dataset_provider_name"),
DBResource.hdx_id.label("resource_hdx_id"),
DBResource.filename.label("resource_filename"),
DBResource.name.label("resource_name"),
DBResource.update_date.label("resource_update_date"),
DBLocation.code.label("location_code"),
DBLocation.name.label("location_name"),
Expand Down
2 changes: 1 addition & 1 deletion src/hapi_schema/db_population.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class DBPopulation(Base):
DBDataset.provider_code.label("dataset_provider_code"),
DBDataset.provider_name.label("dataset_provider_name"),
DBResource.hdx_id.label("resource_hdx_id"),
DBResource.filename.label("resource_filename"),
DBResource.name.label("resource_name"),
DBResource.update_date.label("resource_update_date"),
DBGender.description.label("gender_description"),
DBLocation.code.label("location_code"),
Expand Down
2 changes: 1 addition & 1 deletion src/hapi_schema/db_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class DBResource(Base):
hdx_id: Mapped[str] = mapped_column(
String(36), unique=True, nullable=False
)
filename: Mapped[str] = mapped_column(String(256), nullable=False)
name: Mapped[str] = mapped_column(String(256), nullable=False)
format: Mapped[str] = mapped_column(String(32), nullable=False)
update_date = mapped_column(DateTime, nullable=False, index=True)
download_url: Mapped[str] = mapped_column(
Expand Down
6 changes: 3 additions & 3 deletions tests/sample_data/data_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
id=1,
dataset_ref=1,
hdx_id="90deb235-1bf5-4bae-b231-3393222c2d01",
filename="resource-01.csv",
name="resource-01.csv",
format="csv",
update_date=datetime(2023, 6, 1),
download_url="https://data.humdata.org/dataset/c3f001fa-b45b-464c-9460-1ca79fd39b40/resource/90deb235-1bf5-4bae-b231-3393222c2d01/download/resource-01.csv",
Expand All @@ -15,7 +15,7 @@
id=2,
dataset_ref=1,
hdx_id="b9e438e0-b68a-49f9-b9a9-68c0f3e93604",
filename="resource-02.xlsx",
name="resource-02.xlsx",
format="xlsx",
update_date=datetime(2023, 7, 1),
download_url="https://fdw.fews.net/api/tradeflowquantityvaluefacts/?dataset=1845&country=TZ&fields=simple&format=xlsx",
Expand All @@ -25,7 +25,7 @@
id=3,
dataset_ref=2,
hdx_id="62ad6e55-5f5d-4494-854c-4110687e9e25",
filename="resource-03.csv",
name="resource-03.csv",
format="csv",
update_date=datetime(2023, 8, 1),
download_url="https://data.humdata.org/dataset/7cf3cec8-dbbc-4c96-9762-1464cd0bff75/resource/62ad6e55-5f5d-4494-854c-4110687e9e25/download/resource-03.csv",
Expand Down

0 comments on commit 0752229

Please sign in to comment.