Skip to content

Commit

Permalink
Merge pull request #52 from OCHA-DAP/HDX-9891-fix-loc-ref-in-admin2
Browse files Browse the repository at this point in the history
HDX-9891 fix missing loc ref
  • Loading branch information
turnerm authored Jun 10, 2024
2 parents 35759ed + 46a2007 commit e297c39
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
8 changes: 7 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@ 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.8.11

### Fixed

- Missing location_ref in admin2 view

## 0.8.10

### Changes
### Changed

- Adapted primary keys and make columsn nullable in the VAT tables
- Use the enum casting util in the patch table
Expand Down
1 change: 1 addition & 0 deletions src/hapi_schema/db_admin2.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class DBAdmin2(Base):
DBAdmin1.code.label("admin1_code"),
DBAdmin1.name.label("admin1_name"),
DBAdmin1.is_unspecified.label("admin1_is_unspecified"),
DBAdmin1.location_ref.label("location_ref"),
DBLocation.code.label("location_code"),
DBLocation.name.label("location_name"),
).select_from(
Expand Down
1 change: 1 addition & 0 deletions src/hapi_schema/db_views_as_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class DBAdmin2VAT(Base):
admin1_code: Mapped[str] = mapped_column(String(128))
admin1_name: Mapped[str] = mapped_column(String(512))
admin1_is_unspecified: Mapped[bool] = mapped_column(Boolean)
location_ref: Mapped[int] = mapped_column(Integer)
location_code: Mapped[str] = mapped_column(String(128), index=True)
location_name: Mapped[str] = mapped_column(String(512), index=True)

Expand Down
1 change: 1 addition & 0 deletions tests/test_admin2.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def test_admin2_view(run_view_test):
view_admin2.c.id == 1,
view_admin2.c.admin1_code == "FOO-XXX",
view_admin2.c.location_code == "FOO",
view_admin2.c.location_ref == 1,
),
)

Expand Down

0 comments on commit e297c39

Please sign in to comment.