Skip to content

added validation_config.json WorldDevelopmentIndicators - #1996

Merged
niveditasing merged 85 commits into
datacommonsorg:masterfrom
niveditasing:implemented_golden_checks
Sep 25, 2026
Merged

niveditasing merged 85 commits into
datacommonsorg:masterfrom
niveditasing:implemented_golden_checks

Conversation

@niveditasing

@niveditasing niveditasing commented May 8, 2026 •

Copy link
Copy Markdown
Contributor

New GCS Flag:

  • Introduced --historical_gcs_path (defaulting to gs://unresolved_mcf/world_bank/wdi/deleted_rows_07_2026.csv) to specify the GCS location of deleted historical records.

Merge & Deduplication Logic (worldbank.py):

  • Loads the GCS-hosted historical deleted dataset using retry_call with exponential backoff (3 tries) and fails fast via logging.fatal if the file cannot be read.
  • Concatenates fresh World Bank data and deleted historical data, normalizing key columns and deduplicating across composite keys (StatisticalVariable, ISO3166Alpha3, Year, observationPeriod, unit, measurementMethod, scalingFactor) while prioritizing fresh observations (keep='first').
  • Ensures output/ directory initialization at the start of process() and adds unit tests in worldbank_test.py (test_merge_historical_data).

Import Validation (validation_config.json & manifest.json):

  • Configured DELETED_RECORDS_PERCENT threshold at 0.1%.
  • Added check_max_date_freshness (SQL_VALIDATOR) to verify per-StatVar MaxDate freshness (latest_year >= EXTRACT(YEAR FROM CURRENT_DATE) - 3 for all active StatVars).

Artifacts & Testing Results:

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new validation configuration file, validation_config.json, for the World Bank WDI dataset. It defines rules for checking deleted record counts and performing golden file comparisons. The review feedback highlights path inconsistencies for golden files and a missing directory prefix for input files, which could prevent the validation tool from locating the necessary data.

Comment thread scripts/world_bank/wdi/validation_config.json Outdated
Comment thread scripts/world_bank/wdi/validation_config.json Outdated
@balit-raibot

Copy link
Copy Markdown
Contributor

@gemini-code-assist review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces import validation for the World Bank WDI dataset by adding a validation configuration, updating the manifest, and providing golden data files. Feedback includes a missing file reference for 'golden_WorldBank.csv', a path mismatch for the summary report, and a suggestion to move golden files to a local directory for better self-containment. Additionally, the documentation header in the README should be generalized to describe the process rather than the PR, and the threshold for the deleted records percentage may need adjustment to reflect the intended strictness.

Comment thread scripts/world_bank/wdi/validation_config.json Outdated
Comment thread scripts/world_bank/wdi/validation_config.json Outdated
Comment thread scripts/world_bank/wdi/README.md Outdated
Comment thread scripts/world_bank/wdi/validation_config.json Outdated
@pulkeet-wq

Copy link
Copy Markdown
Contributor

LGTM

@hareesh-ms
hareesh-ms requested a review from ajaits May 25, 2026 09:20
Comment thread scripts/world_bank/wdi/golden_data/golden_WorldBank.csv Outdated
@pulkeet-wq

Copy link
Copy Markdown
Contributor

LGTM

Comment thread scripts/world_bank/wdi/validation_config.json Outdated

@SandeepTuniki SandeepTuniki left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes! I've left a couple of review suggestions inline below.

Also, please update the PR description so it matches the final implementation (it currently still mentions the older gs://resolved_mcf/.../deleted_historical_data_06_2026.csv path, a graceful fallback instead of logging.fatal, and golden checks).

Comment thread scripts/world_bank/wdi/validation_config.json Outdated
Comment thread scripts/world_bank/wdi/worldbank.py Outdated
@SandeepTuniki

SandeepTuniki commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Hi @niveditasing, you comments say the changes are made, but I don't see new commits since my review. Did you forget to push the changes? Also, the PR description still shows the old text.

@niveditasing

Copy link
Copy Markdown
Contributor Author

Hi @niveditasing, you comments say the changes are made, but I don't see new commits since my review. Did you forget to push the changes? Also, the PR description still shows the old text.

Sorry for the inconvenience; I forgot to push the changes earlier. I have resolved the PR comments and pushed the updates now.

@SandeepTuniki SandeepTuniki left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes!

Note: I updated the PR description for now, but please keep it up to date for future PRs.

@niveditasing
niveditasing merged commit 6b24517 into datacommonsorg:master Sep 25, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants