You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Document UK breakdown results' withheld area codes, and stop serving breakdowns cached without them #4091
The simulation API will return, for each level of a UK local-area breakdown, the ONS codes of the areas disclosure control withheld (PolicyEngine/policyengine-sim-api#968). The Public API already stores and returns a breakdown result unchanged once its kind is local_areas (_breakdown_result_kind_error in services/economy_impact_execution.py), so the new fields will pass through. Two things still need doing.
Documentation. The OpenAPI description of the annual economy route's completed breakdown result (openapi_spec.yaml, about line 887) lists kind, the two area lists and the dataset and version fields. It should also describe the withheld codes, and that they are absent from results computed before the simulation API reported them.
Cached results. Breakdown results cached before the change stay cached for up to 30 days without the new fields. A simulation API deploy that keeps the same .py version doesn't change the cache key, so clients would get the list for existing reports only once those entries expire. Bumping RUNTIME_CACHE_SCHEMA_VERSIONS["economy_impact"] would recompute every cached economy result, not just breakdowns. Instead, give breakdown requests their own schema version in the options hash, so that only breakdown results computed before the change are recomputed on the next request.
Done when
The OpenAPI description covers the withheld codes.
A contract test shows a breakdown result with the withheld codes is stored and returned unchanged.
Breakdown results cached before the change are not served, and national results' cache entries are unaffected.
Notes
Order: merge after the simulation API change is deployed.
Activity