[Zurich] Update Zurich_Population and Zurich_Population_Number_Of_Company_Workplace_Employees - #2199
Conversation
…pany_Workplace_Employees - Update data sources to new City of Zurich Open Data endpoints (BEV324OD3240 and WIR255OD2552). - Add rollup aggregation script for wir_2552_wiki. - Update pvmap and metadata configs to map quarter-level records to authenticated Wikidata entities. - Update test data and templates. - Add automated validation configurations with deleted records threshold. - Update README.md and manifest.json. TAG=agy CONV=e14d0b1e-8efd-44a0-b3d1-5640746680a4
There was a problem hiding this comment.
Code Review
This pull request updates the Zurich population and workplace datasets by pointing to new source URLs, expanding test data, updating property-value mappings, and adding validation configurations. It also introduces a preprocessing script (generate_rollups.py) to filter total roll-up rows from the workplace dataset. Feedback on these changes includes adding defensive checks to the preprocessing script to prevent silent failures, reducing excessively high resource limits specified in the manifest, and correcting the place_type metadata from Country to City to accurately reflect the geographic level of the data.
- Correct place_type from Country to City in metadata configs - Reduce resource_limits to cpu: 1, memory: 2, disk: 10 in manifest.json - Add defensive validation checks to generate_rollups.py for empty data and missing columns TAG=agy CONV=e14d0b1e-8efd-44a0-b3d1-5640746680a4
Review Feedback Addressed & Dev Re-ValidationAll code review feedback has been addressed in commit
Cloud Batch Dev Validation Run (europe-west1 / datcom-infosys-dev)Both imports were re-executed and succeeded end-to-end:
|
Code Review Summary & GPaste for PR #2199Per the
|
- Cloud Batch requires sufficient boot disk space for Debian 12 GCE base image + container runtime + python virtual environments. A 10GB disk encounters 'no space left on device'. - Configured disk to 30GB with cpu: 1 and memory: 2, verified working in dev. TAG=agy CONV=e14d0b1e-8efd-44a0-b3d1-5640746680a4
Resource Limits Dev Re-Validation (cpu: 1, memory: 2, disk: 30)Following review feedback to reduce resource limits:
|
Latest Run GCS Bucket Locations & Production RunbookFollowing the latest successful Cloud Batch dev execution with
|
Adversarial Code Review & Quality Audit (PR #2199 & CL 975628338)Overall Status: Action Required (Changes Requested) Key Actionable Findings for PR #2199:
Companion Critique CL 975628338 Findings:
Full Detailed Audit Report & Evidence: https://paste.googleplex.com/6593135594045440 |
- Validation Configs: Added MAX_DATE_CONSISTENT and SQL_VALIDATOR date freshness rules for both imports. - Preprocessor: Hardened generate_rollups.py with absl flags, empty-file checks, and numeric coercion. - Unit Tests: Added comprehensive hermetic test suite generate_rollups_test.py (9/9 passing). - Manifest: Included raw WIR255OD2552.csv in source_files and adopted node_mcf wildcard pattern. - Test Fixtures: Removed unused trailing unit column in test CSV and TMCF to match 4-column runtime schema. - Documentation: Updated README.md geographic level descriptions. BUG=542856409,542859819 TAG=agy CONV=e14d0b1e-8efd-44a0-b3d1-5640746680a4
Code Review & Audit Resolutions (Commit:
|
Code Review & Verification Summary
|
|
Opened Buganizer tracking issue b/557075595 to track deprecating/removing the remaining 6 defunct legacy Zurich imports from |
…rypoint tests - Updated main() in generate_rollups.py to log full exception traceback via logging.fatal(..., exc_info=True). - Added unit tests for main() verifying successful execution and logging behavior on exception. BUG=542856409,542859819 TAG=agy CONV=e14d0b1e-8efd-44a0-b3d1-5640746680a4
Code Review & Verification Status Update (Commit:
|
TAG=agy CONV=e14d0b1e-8efd-44a0-b3d1-5640746680a4
Dev Execution & Validation Verification (Commit:
|
Comprehensive Code Review & Troubleshooting Post-Mortem SummaryAn end-to-end adversarial code review and diagnostic evaluation has been conducted following the 1. Code Review Outcome: APPROVED (0 Actionable Findings Remaining)All in-scope changes across 19 files under
2. Troubleshooting & Root Cause Analysis (RCA)
3. Verification & Clickable Cloud Console LocationsZurich Population (
|
Companion Critique CL 975628338 Review & Deployment Coordination Update
Verification Links:
Cloud Batch Jobs & Staged GCS Buckets (Dev Run):
|
Adversarial Code Review Findings & Investigation Summary (/owl /grill-me)An exhaustive, adversarial review of the PR changes was conducted against the Data Commons import guidelines, companion Piper CL cl/975628338, and Cloud Batch dev executions. Critical Action Items Identified Before Merge:
Dev Batch Verification & Clickable Locations:
Tracking & Documentation Links:
|
Description
This PR updates two automated City of Zurich open data imports under
statvar_imports/zurich/:Zurich_Population(bev_3240_wiki)Zurich_Population_Number_Of_Company_Workplace_Employees(wir_2552_wiki)Key Changes
Zurich_Population: Updated source from old CSV URL to the official Open Data Zurich datasetBEV324OD3240(https://data.stadt-zuerich.ch/dataset/bev_bestand_jahr_quartier_od3240).Zurich_Population_Number_Of_Company_Workplace_Employees: Updated source from old CSV URL toWIR255OD2552(https://data.stadt-zuerich.ch/dataset/bfs_wir_statent_ast_beschaeftigte_vza_rechtsform_betrgr_jahr_od2552).generate_rollups.pyforwir_2552_wikiwith defensive checks for empty datasets and required filter columns.pvmap.csvandmetadata.csvto map Zurich quarters and districts to authenticated Wikidata entities (place_type: City).--output_columnsand--output_countersfor counter metrics.validation_config.jsonwith standardcheck_deleted_records_percentthreshold (0.1) for both imports.statvar_imports/zurich/manifest.jsonandstatvar_imports/zurich/README.md.resource_limits:{"cpu": 1, "memory": 2, "disk": 30}for cost-efficient execution one2-standard-2.Cloud Batch Dev Verification (
datcom-infosys-dev,europe-west1)Zurich_Populationz-pop-abhishekjaisw-20260903-121351SUCCEEDEDZurich_Population_Number_Of_Company_Workplace_Employeesz-pop-co-abhishekjaisw-20260903-121351SUCCEEDEDcheck_deleted_records_percent: PASSED (0% deletions)check_empty_import: PASSEDcheck_missing_refs_count: PASSED (0 missing refs)check_lint_error_count: PASSED (0 errors)Tracking & Runbooks
Zurich_wir_2552_wikiZurich_bev_3240_wikiTAG=agy
CONV=e14d0b1e-8efd-44a0-b3d1-5640746680a4