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
8 changes: 8 additions & 0 deletions scripts/world_bank/wdi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,5 +146,13 @@ If you want to perform "only download", run the below command:
python3 worldbank.py --mode=download
```

### Added golden files and increased the threshold with golden checks in validation_config.json.

The `GOLDENS_CHECK` validator confirms that the import includes a specific set of expected records. This is useful for verifying that critical StatVars, Places, or specific metadata combinations are consistently present in the output.

The validator compares the input data (usually from the stats data source) against one or more "golden" files (MCF or CSV).

If any combination of values in a golden file row is missing from the input, the validation fails. The missing golden rows are then listed in the validation report JSON.

We highly recommend the use of the import validation tool for this import which
you can find in https://github.com/datacommonsorg/tools/tree/master/import-validation-helper.
3 changes: 2 additions & 1 deletion scripts/world_bank/wdi/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"WorldBankCountries.csv",
"schema_csvs/WorldBankIndicators_prod.csv"
],
"cron_schedule": "0 11 * * 2"
"cron_schedule": "0 11 * * 2",
"validation_config_file": "validation_config.json"
}
]
}
28 changes: 28 additions & 0 deletions scripts/world_bank/wdi/validation_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"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.08
}
},
{
"rule_id": "check_goldens_output_csv",
"validator": "GOLDENS_CHECK",
"params": {
"golden_files": "golden_data/golden_WorldBank.csv",
"input_files": "output/WorldBank.csv"
}
},
{
"rule_id": "check_goldens_summary_report",
"validator": "GOLDENS_CHECK",
"params": {
"golden_files": "golden_data/golden_summary_report.csv"
}
}
]
}
Loading
Loading