Document that Census TAX_ID is replaced by our tax-unit construction#1154
Closed
MaxGhenis wants to merge 2 commits into
Closed
Document that Census TAX_ID is replaced by our tax-unit construction#1154MaxGhenis wants to merge 2 commits into
MaxGhenis wants to merge 2 commits into
Conversation
_create_tax_unit_table overwrites the raw Census ASEC TAX_ID with our own construct_tax_units() assignment, retaining the original as CENSUS_TAX_ID. Add a comment explaining the why so the intent (we build tax units ourselves; the Census value is kept only as the validation baseline + required raw-schema column) is legible at the call site. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Refiling from a canonical branch (not a fork) so CI's check-fork gate runs. Replaced by a same-repo PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add an explanatory comment in
CensusCPS._create_tax_unit_tabledocumenting that the raw Census ASECTAX_IDis intentionally replaced by our ownconstruct_tax_units()assignment, and that the original Census value is retained asCENSUS_TAX_ID.Why
Reading the method cold, the line
person["TAX_ID"] = constructed_person["TAX_ID"].valueslooks like it might be silently clobbering the Census filing-unit grouping. It isn't — that's deliberate:"policyengine", applying PE filing/dependency rules) rather than trusting the documented CensusTAX_ID.CENSUS_TAX_IDbecause it's the ground-truth baseline our construction is validated against (validation/cps_tax_unit_validation.py) and a required raw-schema column (_validate_raw_cps_schemaincps.py).So
CENSUS_TAX_IDshould neither be dropped (it would break validation + the schema guard) nor renamed (theUPPER_SNAKEmatches the raw-Census-column convention). The only thing missing was a comment making the intent legible at the call site.Comment-only change; no behavior change.
Tests
ruff check+ruff format --checkpass on the changed file.🤖 Generated with Claude Code