Read dynamics from API v1's dynamic_parameters and dynamic_parameter_values tables

Đang mở
#1,128 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@anth-volk đang làm issue này rồi.

Từ ngày 25/11/2026.

  • #1129 của @anth-volk — đang mở

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
52/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
postgresql, python
Lĩnh vực
backend, databases

Hướng nghiên cứu

Start by reading read_dynamic_reform in policy_reform.py, the model mappings for ParameterValue, and the service privilege list used by /ready. Check the existing tests and helpers that create parameter rows, then compare their table layout with API v1's C1 · 50 revision. Done means dynamic reads use the new tables, current-law rows are excluded, empty dynamics are refused, and the privilege and test helpers cover both tables.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

API v1's C1 · 50 moves dynamic parameters out of parameters into their own table, dynamic_parameters, and their current-law values and every dynamic's values out of parameter_values into dynamic_parameter_values (a nullable dynamic_id, where null means current law, and no policy_id). Its revision moves every stored row with its ID, and its grants give the simulation service's role SELECT on both tables. parameter_values.dynamic_id stays in API v1 until a later change drops it.

The simulation service still reads a dynamic's values from parameter_values rows that name it (read_dynamic_reform, policy_reform.py), and maps parameter_values.dynamic_id. Once C1 · 50's revision has run, it finds no values for any dynamic and refuses every one with 400 dynamic_without_values. Once API v1 drops parameter_values.dynamic_id, a sim release that still filters on it fails every dynamic read with a database error instead of that 400.

Wanted:

  • sim maps dynamic_parameters and dynamic_parameter_values, and reads a dynamic's values and names from them, checking the names against the running catalog version's dynamic parameters. Current-law rows are never read, and a dynamic with no values is still refused;
  • ParameterValue no longer maps dynamic_id, and policy reads are unchanged;
  • the service's privilege list, which /ready and the deploy smoke check use, requires SELECT on both tables;
  • the test helpers write each parameter and value in the table of its kind, as API v1 does;
  • public-api-commit moves to C1 · 50's merge commit on API v1's master.

🤖 Generated with Claude Code

Ngôn ngữ chính
Python
Star
1
Fork
1
Merge trung bình
1 ngày 14 giờ
Pull request đã merge (30 ngày)
60

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của PolicyEngine/policyengine-sim-api

Tất cả issue của PolicyEngine/policyengine-sim-api

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.