From 43a0977fce987ae8ba9e71f09f0a1f6d723a71d8 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Mon, 13 Jul 2026 15:05:43 +0000 Subject: [PATCH] =?UTF-8?q?Report=20landlord=20references=20whose=20portfo?= =?UTF-8?q?lio=20UPRN=20is=20null=20=F0=9F=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 (1M context) --- repositories/condition/property_uprn_lookup.py | 7 ++++++- .../lookups/test_property_uprn_lookup.py | 17 +++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/repositories/condition/property_uprn_lookup.py b/repositories/condition/property_uprn_lookup.py index 0c8082675..cf2b2a344 100644 --- a/repositories/condition/property_uprn_lookup.py +++ b/repositories/condition/property_uprn_lookup.py @@ -1,4 +1,4 @@ -from typing import Dict +from typing import Dict, List from repositories.condition.property_reference_reader import PropertyReferenceReader from repositories.condition.uprn_lookup import UprnLookup @@ -21,3 +21,8 @@ class PropertyUprnLookup(UprnLookup): for ref in references if ref.landlord_property_id is not None and ref.uprn is not None } + + def null_uprn_references(self) -> List[str]: + """Landlord references present in the portfolio whose UPRN is null — + surfaced so a load can report them (none expected; ADR-0064).""" + raise NotImplementedError diff --git a/tests/condition/lookups/test_property_uprn_lookup.py b/tests/condition/lookups/test_property_uprn_lookup.py index f303b55f1..265957b59 100644 --- a/tests/condition/lookups/test_property_uprn_lookup.py +++ b/tests/condition/lookups/test_property_uprn_lookup.py @@ -30,3 +30,20 @@ def test_property_uprn_lookup_excludes_rows_with_no_uprn(): # Assert assert mapping == {"443": 100093305101} + + +def test_property_uprn_lookup_reports_references_with_null_uprn(): + # Arrange + reader = FakePropertyReferenceReader( + [ + PropertyReference(landlord_property_id="443", uprn=100093305101), + PropertyReference(landlord_property_id="999", uprn=None), + ] + ) + lookup = PropertyUprnLookup(reader, portfolio_id=824) + + # Act + null_references = lookup.null_uprn_references() + + # Assert + assert null_references == ["999"]