Merge pull request #957 from Hestia-Homes/main
Some checks failed
Fast Api Backend Deploy / deploy (push) Has been cancelled
Deploy infrastructure / determine_stage (push) Has been cancelled
Deploy infrastructure / address2uprn_lambda (push) Has been cancelled
Deploy infrastructure / postcodeSplitter_image (push) Has been cancelled
Deploy infrastructure / postcodeSplitter_lambda (push) Has been cancelled
Deploy infrastructure / condition_etl_image (push) Has been cancelled
Deploy infrastructure / ara_engine_lambda (push) Has been cancelled
Deploy infrastructure / condition_etl_lambda (push) Has been cancelled
Deploy infrastructure / address2uprn_image (push) Has been cancelled
Deploy infrastructure / shared_terraform (push) Has been cancelled
Deploy infrastructure / ara_engine_image (push) Has been cancelled
Deploy infrastructure / categorisation_image (push) Has been cancelled
Deploy infrastructure / categorisation_lambda (push) Has been cancelled
Deploy infrastructure / ordnanceSurvey_image (push) Has been cancelled
Deploy infrastructure / ordnanceSurvey_lambda (push) Has been cancelled
Deploy infrastructure / pashub_to_ara_image (push) Has been cancelled
Deploy infrastructure / pashub_to_ara_lambda (push) Has been cancelled
Deploy infrastructure / fast_api_lambda (push) Has been cancelled
Deploy infrastructure / cloudfront_acm (push) Has been cancelled
Deploy infrastructure / cloudfront_cdn (push) Has been cancelled
Deploy infrastructure / hubspot_etl_image (push) Has been cancelled
Deploy infrastructure / hubspot_etl_lambda (push) Has been cancelled

erroneous postcode don't just get dropped but logged
This commit is contained in:
Daniel Roth 2026-04-02 15:33:28 +01:00 committed by GitHub
commit e0194798e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -462,6 +462,15 @@ def handler(event, context, local=False):
# Validate postcode before processing
if not AddressMatch.is_valid_postcode(postcode):
logger.warning(f"Postcode {postcode} is invalid, skipping")
for row in postcode_rows:
results_data.append(
{
**row,
"address2uprn_uprn": "invalid postcode",
"address2uprn_address": "invalid postcode",
"address2uprn_lexiscore": "invalid postcode",
}
)
continue
# Fetch EPC data once per postcode