Skip to content

Commit

Permalink
Merge pull request #10 from OCHA-DAP/HAPI-234/dataset-provider-info
Browse files Browse the repository at this point in the history
HAPI-234 dataset provider info change
  • Loading branch information
turnerm authored Oct 25, 2023
2 parents 0752229 + cb12389 commit 814a697
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 14 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.2]

### Changed

- HDX provider code and name change

## [0.3.1]

### Changed
Expand Down
4 changes: 2 additions & 2 deletions src/hapi_schema/db_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ class DBDataset(Base):
String(128), unique=True, nullable=False
)
title = mapped_column(String(1024), nullable=False)
provider_code: Mapped[str] = mapped_column(
hdx_provider_stub: Mapped[str] = mapped_column(
String(128), nullable=False, index=True
)
provider_name: Mapped[str] = mapped_column(
hdx_provider_name: Mapped[str] = mapped_column(
String(512), nullable=False, index=True
)

Expand Down
4 changes: 2 additions & 2 deletions src/hapi_schema/db_operational_presence.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ class DBOperationalPresence(Base):
DBDataset.hdx_id.label("dataset_hdx_id"),
DBDataset.hdx_stub.label("dataset_hdx_stub"),
DBDataset.title.label("dataset_title"),
DBDataset.provider_code.label("dataset_provider_code"),
DBDataset.provider_name.label("dataset_provider_name"),
DBDataset.hdx_provider_stub.label("dataset_hdx_provider_stub"),
DBDataset.hdx_provider_name.label("dataset_hdx_provider_name"),
DBResource.hdx_id.label("resource_hdx_id"),
DBResource.name.label("resource_name"),
DBResource.update_date.label("resource_update_date"),
Expand Down
4 changes: 2 additions & 2 deletions src/hapi_schema/db_population.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ class DBPopulation(Base):
DBDataset.hdx_id.label("dataset_hdx_id"),
DBDataset.hdx_stub.label("dataset_hdx_stub"),
DBDataset.title.label("dataset_title"),
DBDataset.provider_code.label("dataset_provider_code"),
DBDataset.provider_name.label("dataset_provider_name"),
DBDataset.hdx_provider_stub.label("dataset_hdx_provider_stub"),
DBDataset.hdx_provider_name.label("dataset_hdx_provider_name"),
DBResource.hdx_id.label("resource_hdx_id"),
DBResource.name.label("resource_name"),
DBResource.update_date.label("resource_update_date"),
Expand Down
4 changes: 2 additions & 2 deletions src/hapi_schema/db_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ class DBResource(Base):
DBDataset.hdx_id.label("dataset_hdx_id"),
DBDataset.hdx_stub.label("dataset_hdx_stub"),
DBDataset.title.label("dataset_title"),
DBDataset.provider_code.label("dataset_provider_code"),
DBDataset.provider_name.label("dataset_provider_name"),
DBDataset.hdx_provider_stub.label("dataset_hdx_provider_stub"),
DBDataset.hdx_provider_name.label("dataset_hdx_provider_name"),
).select_from(
DBResource.__table__.join(
DBDataset.__table__,
Expand Down
8 changes: 4 additions & 4 deletions tests/sample_data/data_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
hdx_id="c3f001fa-b45b-464c-9460-1ca79fd39b40",
hdx_stub="dataset01",
title="Dataset #1",
provider_code="provider01",
provider_name="Provider #1",
hdx_provider_stub="provider01",
hdx_provider_name="Provider #1",
),
dict(
id=2,
hdx_id="7cf3cec8-dbbc-4c96-9762-1464cd0bff75",
hdx_stub="dataset02",
title="Dataset #2",
provider_code="provider02",
provider_name="Provider #2",
hdx_provider_stub="provider02",
hdx_provider_name="Provider #2",
),
]
4 changes: 2 additions & 2 deletions tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ def test_dataset_view(run_view_test):
view_dataset.c.id == 1,
view_dataset.c.hdx_stub == "dataset01",
view_dataset.c.title == "Dataset #1",
view_dataset.c.provider_code == "provider01",
view_dataset.c.provider_name == "Provider #1",
view_dataset.c.hdx_provider_stub == "provider01",
view_dataset.c.hdx_provider_name == "Provider #1",
),
)

Expand Down

0 comments on commit 814a697

Please sign in to comment.