Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

Document UK breakdown results' withheld area codes, and stop serving breakdowns cached without them

Aberta
#4,091 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 3 dias

@anth-volk já está trabalhando nisso.

Desde 28/10/2026.

  • #4104 de @anth-volk — aberto

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
43/100
Tipo de issue
Funcionalidade
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
openapi, python

Direção de pesquisa

Read the completed breakdown result description around line 887 in openapi_spec.yaml and inspect _breakdown_result_kind_error in services/economy_impact_execution.py. Find the options hash and its schema version handling, then check the contract tests for breakdown results. Done means the OpenAPI description documents withheld codes and older breakdown cache entries are bypassed while national result cache entries remain unaffected.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Problem

The simulation API will return, for each level of a UK local-area breakdown, the ONS codes of the areas disclosure control withheld (https://github.com/PolicyEngine/policyengine-sim-api/issues/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.

  1. 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.
  2. 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.
  • Related: the app will hatch only the listed codes as "Not reported" and show any other absent area as "No data" (PolicyEngine/policyengine-app-v2#1448 review).
Linguagem predominante
Python
Estrelas
18
Forks
33
Merge médio
2d 16h
PRs com merge (30d)
53

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de PolicyEngine/policyengine-api

Todas as issues de PolicyEngine/policyengine-api

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.