Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"MinDate","StatVar","observationPeriods","Units","ScalingFactors","MeasurementMethods","NumPlaces"
"1900","Count_Person","[P1Y]","[]","[]","[CensusPEPSurvey]","23057"
3 changes: 2 additions & 1 deletion scripts/us_census/pep/annual_population/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"cleaned_csv": "output_files/usa_annual_population.csv"
}
],
"cron_schedule": "0 10 * * 2"
"cron_schedule": "0 10 * * 2",
"validation_config_file": "validation_config.json"
}
]
}
4 changes: 2 additions & 2 deletions scripts/us_census/pep/annual_population/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def _load_data_df(path: str,
elif file_format.lower() == "txt":
data_df = pd.read_table(path,
index_col=False,
delim_whitespace=True,
sep=r'\s+',
engine='python',
header=header,
skiprows=skip_rows)
Expand All @@ -148,7 +148,7 @@ def _geo_id(val: pd.Series) -> str:
str: State/County GeoId
"""
res = "geoId/"
state, county = val[0], val[1]
state, county = val.iloc[0], val.iloc[1]
if county == "000":
return res + state
return res + state + county
Expand Down
20 changes: 20 additions & 0 deletions scripts/us_census/pep/annual_population/validation_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"schema_version": "1.0",
"rules": [
{
"rule_id": "check_deleted_records_percent",
"description": "Checks that the percentage of deleted points is within the threshold.",
"validator": "DELETED_RECORDS_PERCENT",
"params": {
"threshold": 0.1
}
},
{
"rule_id": "check_goldens_summary_report",
"validator": "GOLDENS_CHECK",
"params": {
"golden_files": "../../../../golden_data/golden_summary_report.csv"
}
}
]
}
Loading