Skip to content

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

Open

Description

@MaxGhenis

Found by the round-1 independent review of #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 44ddec5). 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions