Skip to content

[Zurich] Add consolidated bev_3903_all and bev_4031_all StatVar imports (Zurich_Population_By_Age_Sex_Origin_Combined & Zurich_Population_Number_Of_Birth_By_Sex_Origin_Combined) - #2232

Open
abhishekjaisw wants to merge 7 commits into
datacommonsorg:masterfrom
abhishekjaisw:zurich-bev-3903-4031-combined

Conversation

@abhishekjaisw

@abhishekjaisw abhishekjaisw commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add 2 consolidated multi-dimensional Zurich demographic imports (Zurich_Population_By_Age_Sex_Origin_Combined and Zurich_Population_Number_Of_Birth_By_Sex_Origin_Combined) while retaining the 6 existing legacy split imports (Zurich_Population_By_Age, Zurich_Population_By_Origin, Zurich_Population_By_Sex, Zurich_Population_Number_Of_Birth, Zurich_Population_Number_Of_Birth_By_Origin, Zurich_Population_Number_Of_Birth_By_Sex) until removal is finalized:

  1. Zurich_Population_By_Age_Sex_Origin_Combined (statvar_imports/zurich/bev_3903_all/):
    • Ingests BEV390OD3903.csv (https://data.stadt-zuerich.ch/dataset/bev_bestand_jahr_quartier_alter_herkunft_geschlecht_od3903).
    • generate_rollups.py aggregates economic population (AnzBestWir) across Quarter (QuarLang), District (KreisLang), and City (Ganze Stadt, wikidataId/Q72) and across all 8 demographic combinations (Age x Sex x Origin, 2-way marginals, 1-way marginals, and total population), emitting 108 StatVars (159,505 observations).
  2. Zurich_Population_Number_Of_Birth_By_Sex_Origin_Combined (statvar_imports/zurich/bev_4031_all/):
    • Ingests BEV403OD4031.csv (https://data.stadt-zuerich.ch/dataset/bev_tag_geburten_quartier_geschl_ag_herkunft_od4031).
    • generate_rollups.py aggregates daily live births (AnzGebuWir) into annual counts across Quarter, District, and City and across all 4 demographic combinations (Sex x Origin, 1-way marginals, and total births), emitting 9 StatVars (12,086 observations).
  3. Legacy Split Imports Retained:
    • All 6 legacy split import directories, zurich_population_common.tmcf, and their manifest.json / README.md entries remain untouched in statvar_imports/zurich/ for now until removal is finalized.

Verification

  • pytest statvar_imports/zurich/: 39/39 unit tests passed (bev_3903_all/generate_rollups_test.py, bev_4031_all/generate_rollups_test.py, wir_2552_wiki/generate_rollups_test.py).
  • pytest import-automation/workflow/import_automation_workflow_test.py: 16/16 passed (catalog count = 200).
  • yapf --diff -r on statvar_imports/zurich/bev_3903_all/ and statvar_imports/zurich/bev_4031_all/: 0 formatting diffs.
  • Full executor pipeline verified on commit 373890be737712744167b3f0c22d2065648b17c4: both consolidated imports reached ImportStatus.STAGING with 6/6 validation rules (check_deleted_records_percent, check_empty_import, check_missing_refs_count, check_lint_error_count, check_max_date_consistent, check_max_date_freshness) passing (0 lint errors, 0 missing refs, 0.0% deleted records).

@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 consolidates several legacy Zurich population and birth imports into two unified imports: Zurich_Population_By_Age_Sex_Origin_Combined and Zurich_Population_Number_Of_Birth_By_Sex_Origin_Combined. It introduces new rollup generation scripts (generate_rollups.py) and associated unit tests under bev_3903_all and bev_4031_all to handle spatial and demographic aggregations. Legacy metadata, mapping, and raw data files have been removed, and manifest.json has been updated accordingly. There are no review comments to evaluate, and I have no additional feedback to provide.

@abhishekjaisw abhishekjaisw changed the title [Zurich] Consolidate bev_3903_all and bev_4031_all StatVar imports (Zurich_Population_By_Age_Sex_Origin_Combined & Zurich_Population_Number_Of_Birth_By_Sex_Origin_Combined) [Zurich] Add consolidated bev_3903_all and bev_4031_all StatVar imports (Zurich_Population_By_Age_Sex_Origin_Combined & Zurich_Population_Number_Of_Birth_By_Sex_Origin_Combined) Sep 25, 2026
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