|
Some checks failed
CI / backend-tests (push) Has been cancelled
CI / frontend-tests (push) Has been cancelled
CI / openapi-codegen-check (push) Has been cancelled
CI / changes (push) Has been cancelled
CI / changes (pull_request) Successful in 6s
CI / backend-tests (pull_request) Has been cancelled
CI / frontend-tests (pull_request) Has been cancelled
CI / openapi-codegen-check (pull_request) Has been cancelled
Adds period_type TEXT NOT NULL DEFAULT 'unknown' to macro_indicator and
widens the PRIMARY KEY to (indicator_type, region, obs_date, period_type).
Before: yearly aggregate ('год'→obs_date YYYY-01-01) and Q1 ('I квартал'→
same date) shared the same PK slot → ON CONFLICT DO UPDATE made them
overwrite each other despite the in-memory dedup fix in #1687.
After: each EmissRow carries period_type from _emiss_period_granularity
('year'/'quarter'/'month'); DB ON CONFLICT targets include it, so
yearly+Q1 rows genuinely coexist.
Non-EMISS sources (CBR, rosstat open-data, domrf) use period_type='unknown'
(literal in SQL) — they are disambiguated by obs_date already, so the
wider PK is backward-compatible. All ON CONFLICT clauses in
cbr_macro_sync.py and rosstat_macro_sync.py updated accordingly.
Migration: 163_emiss_pk_period_type.sql (idempotent BEGIN/COMMIT).
Tests: 49 passed (emiss + rosstat suite), ruff clean, py_compile OK.
|
||
|---|---|---|
| .. | ||
| __init__.py | ||
| cbr_macro_sync.py | ||
| developer_registry_refresh.py | ||
| ekb_krt_sync.py | ||
| ekb_ppt_tep_sync.py | ||
| ekburg_permits_sync.py | ||
| etl_newbuilding_crossload.py | ||
| forecast.py | ||
| genplan_zones_sync.py | ||
| gknspecial_harvest.py | ||
| ird_harvest.py | ||
| izyatie_ocr_ingest.py | ||
| krt_geometry_sync.py | ||
| location_refresh.py | ||
| noise_sync.py | ||
| nspd_denorm_backfill.py | ||
| nspd_geo.py | ||
| nspd_sync.py | ||
| objective_etl.py | ||
| okn_objects_sync.py | ||
| opportunity_harvest.py | ||
| pat_subzones_load.py | ||
| planning_harvest.py | ||
| poi_sync.py | ||
| pzz_sync.py | ||
| refresh_analytics.py | ||
| refresh_layout_velocity.py | ||
| refresh_quarter_price_index.py | ||
| reservation_ingest.py | ||
| rosstat_macro_sync.py | ||
| scrape_cadastre.py | ||
| scrape_kn.py | ||
| scrape_kn_catalog_objects.py | ||
| scrape_objective.py | ||
| supply_layers_refresh.py | ||
| zone_regulation_refresh.py | ||