Skip to content

fix: handle null county names for pseudo-county areas#1364

Merged
cblanc merged 7 commits into
mainfrom
pcio-county-fix
May 29, 2026
Merged

fix: handle null county names for pseudo-county areas#1364
cblanc merged 7 commits into
mainfrom
pcio-county-fix

Conversation

@cblanc
Copy link
Copy Markdown
Member

@cblanc cblanc commented May 29, 2026

Summary

  • Upstream dump now nulls county names when the underlying GSS code is pseudo (e.g. S99999999 for Scotland, E99999999 for England)
  • Outcodes query coalesces NULL array aggregates to empty arrays, keeping the string[] contract
  • Test seed regenerated from updated upstream dump; all fixtures and docs updated to match

Test plan

  • Typecheck passes
  • Tests updated to reflect null county names (postcodes) and empty arrays (outcodes)
  • Seed file renamed and all references updated

cblanc added 7 commits May 29, 2026 11:45
Normalise NULL results from array_agg (when no source rows pass the
FILTER clause) into empty arrays. Outcodes contract is string[], never
null — this ensures the types match the runtime behaviour when
pseudo-county areas produce no names to aggregate.
Postcode admin_county is now nullable (null when county GSS is pseudo).
Outcode admin_county is empty array (coalesced from null aggregates).

Update schemas and descriptions to clarify the new behaviour.
Postcode admin_county now null (was pseudo string).
Outcode admin_county now empty array (was array with pseudo string).

Update test expectations to match the new contract.
Regenerated test seed (test/seed/seed.sql.gz) from latest upstream dump
which now sets admin_county to null when the underlying GSS code is a
pseudo (e.g. S99999999 for Scotland). The GSS code itself remains in
codes.admin_county for reference.

This fixes the postcode/outcode contract mismatch where names were
showing '(pseudo) Scotland' instead of null.
The admin_county example was an empty string, contradicting the
nullable contract and the pseudo-county null behaviour. Set it to null
and regenerate the static OpenAPI specs and API reference docs.
@cblanc cblanc merged commit a01d46a into main May 29, 2026
1 check failed
@idealbot
Copy link
Copy Markdown
Member

🎉 This issue has been resolved in version 19.0.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants