County rung: a malformed-geography refusal leaves an old county_surface.json success receipt

Đang mở Phù hợp với người mới
#1,638 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

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
data-engineering

Hướng nghiên cứu

Bắt đầu với check_support() trong tools/us_acs_local_county_surface.py và theo dõi cách các trường hợp từ chối ở cấp quận được ghi lại; so sánh với cách xử lý từ chối county-facts trong prepare_run(). Thêm bài kiểm thử được đề xuất, bắt đầu bằng một biên nhận thành công, sau đó cung cấp bang 01 và quận 06001. Hoàn tất khi giai đoạn ghi {"status": "refused", "error": ...} vào county_surface.json sau khi từ chối địa lý không hợp lệ.

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

Mô tả

Found by the round-1 independent review of PolicyEngine/microcosm#1630. The problem also exists on the base branch, so it is out of that PR's scope.

What happens. check_support() in tools/us_acs_local_county_surface.py calls county_codes() before it writes any receipt (line 2453 at 44ddec5a8). When a household's geography is malformed, for example state 01 with county 06001, county_codes() refuses and the stage exits. county_surface.json in the checkpoint directory is not updated, so a success receipt from an earlier run in the same directory stays in place.

Why it matters. Anything that reads the checkpoint directory afterwards, whether a person, a resume or a later stage, sees a success receipt for a run that was refused.

Suggested fix. Write every county refusal through one helper that records {"status": "refused", "error": ...} in county_surface.json, as prepare_run() already does for county-facts refusals. Alternatively, remove any earlier receipt when the stage starts. Add a test that starts from a success receipt, then feeds state 01 with county 06001, and checks that the receipt now reads as refused.

Part of #922.

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

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/microcosm

Tất cả issue của PolicyEngine/microcosm

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.