implemented golden checks Uscensuspep_annual_population#2037
Open
niveditasing wants to merge 17 commits into
Open
implemented golden checks Uscensuspep_annual_population#2037niveditasing wants to merge 17 commits into
niveditasing wants to merge 17 commits into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces validation configuration for the US Census PEP annual population data. It adds a new golden summary report CSV, updates the manifest to include a validation configuration file, and defines several validation rules including record deletion thresholds and golden file comparisons. A review comment identifies that the check_goldens_summary_report rule is missing the input_files parameter, which is necessary for the validator to correctly compare against the summary report.
Contributor
|
LGTM |
f330147 to
1a3b3fa
Compare
saanikaaa
approved these changes
Jul 10, 2026
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 changes were made in preprocess.py?
Change: Replaced delim_whitespace=True with sep=r'\s+' inside pd.read_table().
Why: In Pandas 2.2.0+, the delim_whitespace parameter was deprecated and removed, causing the script to crash with a TypeError when processing space-separated text files (e.g., e7079co.txt). Using sep=r'\s+' achieves the exact same behavior using standard regex and is fully supported in modern Pandas versions.
Change: Updated state, county = val[0], val[1] to use explicit position-based indexing: state, county = val.iloc[0], val.iloc[1].
Why: Direct bracket indexing (val[0]) on Series objects can be ambiguous in newer Pandas versions, often confusing index labels with integer positions. Switching to .iloc explicitly guarantees positional access, silencing future warnings and preventing potential runtime bugs.
Impact & Verification
Pipeline Stability: The entire preprocessing pipeline now runs successfully on all 80 input files (including legacy .txt files) without crashing.
Testing results: https://pantheon.corp.google.com/storage/browser/datcom-import-test/scripts/us_census/pep/annual_population/USCensusPEP_Annual_Population/2026_07_08T03_12_32_164951_07_00?inv=1&invt=AbrLyg&mods=-monitoring_api_staging&project=datcom-infosys-dev&pageState=(%22StorageObjectListTable%22:(%22f%22:%22%255B%255D%22))
PR checklist: https://docs.google.com/spreadsheets/d/1BzweR9Sj58j0H2_BweGTmfE4Z1lrjPZL8u1FS0kzCeg/edit?pli=1&gid=0#gid=0