Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Drop the empty simulation-domain tables and retired association columns from the v2 schema

已关闭
#3,961 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 3 天内回复

还没有人认领这个 Issue。

  • #3963 来自 @anth-volk —— 已关闭,未合并

评估

难度
5/5
预计耗时
一周以上
新手友好度
20/100
Issue 类型
重构
描述清晰度
描述清楚
活跃度
停滞
技术栈
postgresql, python, sqlalchemy
领域
api, backend, database

调研方向

Start with the v2 models in policyengine_api/data/v2/models/reports.py, simulations.py, and households.py, plus policyengine_api/data/v2/report_runs.py; first verify that #3960 is deployed and operators have confirmed the tables are empty in both environments. Then inspect the v2 Alembic migration and the named publication, qualification, metadata validation, and static check entry points. Done means the tables, enum types, and retired columns are dropped, remaining code no longer depends on the models, and validation prevents their return.

由索引模型根据 Issue 内容生成。

描述

Problem

The Public API's v2 (Supabase) schema still has dormant copies of the simulation-domain tables: household_jobs, simulations, reports, report_runs and the 11 report-run output tables (aggregates, change_aggregates, budget_summary, decile_impacts, intra_decile_impacts, inequality, poverty, program_statistics, congressional_district_impacts, constituency_impacts and local_authority_impacts). Nothing writes to them. The simulation service will own jobs, reports and their results in its own simulation schema and will create the tables it needs there, so these copies and their SQLModel models only invite new code to start using the wrong tables. Proposals that build on v2 reports in the Public API, such as #3818's report_validations table, belong on the simulation service's report tables instead.

user_simulation_associations and user_report_associations also still have the country and label columns that Stage 12A retired and left nullable.

Proposed change

Once #3960 (which stops the application from using these tables and columns) is deployed to both environments, and once an operator has confirmed in both environments that the tables are empty:

  • Remove the simulation-domain models (policyengine_api/data/v2/models/reports.py, simulations.py, and HouseholdJob in households.py) and the unused policyengine_api/data/v2/report_runs.py.
  • Add an autogenerated v2 Alembic revision that drops the 15 tables, their 8 native enum types and the 4 retired association columns.
  • catalog/publication.py: check only dataset-version rows before and after publication.
  • household_migration_qualification.py: count the dropped tables by name for targets that still have them, instead of through the removed models.
  • Reject the dropped table names in the v2 metadata validation, and add a registered static check (api.v2.simulation-tables-stay-removed) that fails if code imports the removed models again.
主要语言
Python
星标
18
派生
33
平均合并
2 天 6 小时
30 天内合并 PR
32

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

PolicyEngine/policyengine-api 的其他 Issue

查看 PolicyEngine/policyengine-api 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。