Skip to content

OECD_Waste_Water_Treatment cloud job fix and goldens#2098

Open
saanikaaa wants to merge 6 commits into
datacommonsorg:masterfrom
saanikaaa:oecd_waste_water_fix
Open

OECD_Waste_Water_Treatment cloud job fix and goldens#2098
saanikaaa wants to merge 6 commits into
datacommonsorg:masterfrom
saanikaaa:oecd_waste_water_fix

Conversation

@saanikaaa

@saanikaaa saanikaaa commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

The PR is raised to fix OECD_Waste_Water_Treatment import cloud job which was failing due to deletions and also to add the golden test for the same.

The auto-refresh job was failing due to 6.87% (512) deleted records, which triggered a validation error. Verified against the source that deletions are as per source itself. More details with attached screenshot can be found here.

To fix this we have pulled all the deleted 512 data points from prod and uploaded to GCP Bucket. A common script is created "merged_historical_data.py" which helps in merging the output csv generated from statvar_processor and append/de-duplicate historical data to it for fullness of output data. This script can be used in future for merging purpose for the imports which are generated by statvar processor.

Differ: https://screenshot.googleplex.com/3vZEs7Q9NGEsLxg - Here we can see there are no deletions. Only points modification and additions. These modification are validated - Link

SOP: Link

PR_CHECKLIST: Link

@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 utility script merge_historical_data.py to reconcile and merge current wastewater treatment data with historical records, alongside adding validation configurations and golden datasets. Feedback on the script highlights critical improvements: normalizing key columns to strings to prevent merge mismatches due to differing data types, filtering the merged DataFrame directly to avoid index alignment bugs, and utilizing file_util.FileIO to ensure reliable writing to Google Cloud Storage paths.

Comment thread tools/statvar_importer/merge_historical_data.py Outdated
Comment thread tools/statvar_importer/merge_historical_data.py Outdated
Comment thread tools/statvar_importer/merge_historical_data.py
Comment thread statvar_imports/oecd/wastewater_treatment/validation_config.json Outdated
Comment thread tools/statvar_importer/merge_historical_data.py Outdated
Comment thread tools/statvar_importer/merge_historical_data.py Outdated
Comment thread statvar_imports/oecd/wastewater_treatment/manifest.json Outdated
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.

2 participants