feat(tradein): СберИндекс monthly city-level price index pull (#887, data-layer) #890
No reviewers
Labels
No labels
admin
analytics
auth
automation
bug
business
chore
ci
compliance
data
data-moat
docs
duplicate
dx
enhancement
Fable 5 ревью
feedback/max
generative
GG-форсайт
needs-discussion
needs-human
observability
pause-bots
performance
priority/p0
priority/p1
priority/p2
priority/p3
scope/backend
scope/db
scope/devops
scope/frontend
scope/qa
scrapers
security
site-finder
stage/1
stage/2
status/blocked
status/done
status/needs-analysis
status/needs-fix
status/qa
status/ready
status/review
status/wip
tech-debt
tradein
ux
week ревью 1
wontfix
вторичка
ИРД
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lekss361/gendesign#890
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/887-sberindex-pull"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Data-layer of #887 (steps 1-3+5). estimator.py untouched — the client-visible time-adjust wire (step 4) is deferred to a separate backtest-gated follow-up. Additive only (CREATE TABLE IF NOT EXISTS) — safe to merge.
sber_price_index(city, period_month, segment, dashboard, index_value_rub_m2, source, fetched_at)PK(city,period_month,dashboard).source=sber_index_pull, monthly,ON CONFLICT(source) DO NOTHING).sber_index.py: base64/api/sowaroute builder + response decoder + async httpx fetch + idempotent upsert (ON CONFLICT ... DO UPDATE). 3 dashboards (deals/hedonic/asking), REALTY=2, per-series graceful errors, asking benchmark log.trigger_sber_index_pull_run+ dispatch branch.Test plan
pytest -k sber20 passed; ruff clean; no:x::type.SBER_REF_AREAShas643=РФ+ a TODO. Confirm EKB/Moscow codes via a browser/prod session and add them (1-line). Until then the pull only has РФ.Refs #887, #794, #652
✅ APPROVE — СберИндекс data-layer (#887 steps 1-3+5), additive, estimator не тронут.
Cruxes проверены:
sber_index.py): bind-params +CAST(:x AS type)(НЕ:x::type),ON CONFLICT (city,period_month,dashboard) DO UPDATEсовпадает с PK миграции 092, period →.isoformat()→CAST date. Per-series try/except (HTTPStatusError/RequestError/broad) → errors++ + continue, каждый dashboard×city коммитится отдельно (нет cross-series rollback).pull_sber_indices(db)существует → taskrun_sber_index_pullимпортит верно, mark_done/mark_failed+raise.trigger_sber_index_pull_runзеркалит #866, dispatchelif "sber_index_pull"сосуществует с прочими ветками.CREATE TABLE/INDEX IF NOT EXISTS+ BEGIN/COMMIT, standalone, PK sane — идемпотентна, additive.ON CONFLICT(source) DO NOTHING,next_run_at=завтра 05:00 → не стрельнёт на деплое (паттерн 078/091). enabled=true оправдан (pure HTTP+DB, 9 req/run monthly).Безопасность: estimator.py untouched → нет client-visible pricing → gate не нужен (в отличие от #877); time-adjust (step 4) явно отложен в backtest-gated follow-up. httpx (sberindex не anti-bot, прокси не нужен), секретов нет, self-extending нет. 11 тестов.
🟡 non-blocking: REF_AREA только РФ-643 (EKB/MSK TBD — TLS из worker env недоступен). Таблица estimator'ом пока не читается → РФ-only данные ничему не вредят; коды добавятся 1 строкой в follow-up. Migration 092/093 — проверьте что номера свободны (но IF NOT EXISTS + standalone → коллизия номера не фатальна).
Мержу. #887 → qa (smoke: trigger pull → sber_price_index наполнилась для РФ).