Skip to content

Added historical data in gcs bucket WorldBankDatasets#2077

Open
niveditasing wants to merge 4 commits into
datacommonsorg:masterfrom
niveditasing:world_bank_gcs
Open

Added historical data in gcs bucket WorldBankDatasets#2077
niveditasing wants to merge 4 commits into
datacommonsorg:masterfrom
niveditasing:world_bank_gcs

Conversation

@niveditasing

@niveditasing niveditasing commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

New GCS Flag: Introduced historical_gcs_path : https://storage.mtls.cloud.google.com/unresolved_mcf/world_bank/datasets/deleted_historical_data_06_2026.csv
to track the location of deleted historical records.
Merge & Deduplication Logic:
* Added a try-except block to load the GCS-hosted deleted data safely.
* Concatenated fresh data and deleted historical data.
* Deduplicated records based on composite keys (indicatorcode, statvar, measurementmethod, observationabout, observationdate, unit),
prioritizing newer observations (keep='first').
* Implemented a graceful fallback to proceed with only the fresh data in case the GCS read or parsing fails.

Differ summary: https://storage.mtls.cloud.google.com/unresolved_mcf/world_bank/datasets/differ_summary.json

PR checklist: https://docs.google.com/spreadsheets/d/1BzweR9Sj58j0H2_BweGTmfE4Z1lrjPZL8u1FS0kzCeg/edit?pli=1&gid=0#gid=0

@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 adds a new GCS path flag and logic to merge and deduplicate deleted historical data into the processed output. The review feedback points out that importing and using pandas introduces an unnecessary external dependency and risks silent data corruption due to automatic type inference. It is recommended to use Python's built-in csv module to safely perform the merge and deduplication instead.

Comment thread scripts/world_bank/datasets/process.py
@niveditasing niveditasing changed the title testing Added historical data in gcs bucket WorldBankDatasets Jul 7, 2026
@niveditasing niveditasing force-pushed the world_bank_gcs branch 2 times, most recently from 1817c23 to 8df2531 Compare July 8, 2026 07:57
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.

1 participant