Drop the empty simulation-domain tables and retired association columns from the v2 schema
Les mainteneurs répondent en général sous 3 jours
Personne n'a encore pris cette issue.
- #3963 par @anth-volk — fermée sans fusion
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 20/100
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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, andHouseholdJobinhouseholds.py) and the unusedpolicyengine_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.
- Langage dominant
- Python
- Étoiles
- 18
- Forks
- 33
- Merge moyen
- 2 j 6 h
- PR mergées (30 j)
- 32
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de PolicyEngine/policyengine-api
-
Difficulté 1/5 1-3 heures Accessibilité débutants 88/100
PolicyEngine/policyengine-api#3911 ·
Les mainteneurs répondent en général sous 3 jours
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 82/100
PolicyEngine/policyengine-api#3910 ·
Les mainteneurs répondent en général sous 3 jours
-
Report each day's production telemetry error groups as GitHub issuesPeut-être pris @anth-volk l’a pris aujourd’hui. Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 20/100
PolicyEngine/policyengine-api#3989 ·
Les mainteneurs répondent en général sous 3 jours
-
Include each variable's quantity type (stock or flow) in the country metadataPeut-être pris @anth-volk l’a pris il y a 1 jour. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 30/100
PolicyEngine/policyengine-api#3986 ·
Les mainteneurs répondent en général sous 3 jours
-
Enforce SQLAlchemy-only database connections and Alembic-only schema changesPeut-être pris @anth-volk l’a pris il y a 1 jour. Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
PolicyEngine/policyengine-api#3978 ·
Les mainteneurs répondent en général sous 3 jours
Toutes les issues de PolicyEngine/policyengine-api
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 77/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 67/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
pgvector/pgvector-python#169 ·
-
ChaosEngine: backup-remote doctor row passes while consumer mode hides bot memory from gitPeut-être pris @MohabMohie l’a pris aujourd’hui. Ouverteagentic
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
ShaftHQ/SHAFT_ENGINE#7263 ·
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 87/100
huggingface/smolagents#3045 ·
Les mainteneurs répondent en général sous 1 jour