feat(tradein): DaData /clean/address backfill для houses (PR Q3) #606
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lekss361/gendesign#606
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/tradein-dadata-house-backfill"
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
Закрывает Q-серию по DaData. После Q1 (#604, on-demand enrich /estimate) + Q2 (#605, /suggest tier) — теперь batch enrichment всего houses через DaData /clean/address.
Зачем
Из 12,437 houses на проде:
lat IS NULL OR lon IS NULL(нет coords)cadastral_number IS NULL(100%, у Yandex нет cadnum)DaData /clean/address возвращает coords +
house_cadnum+house_fias_id+ qc-коды. На demo квоте 100 req/день → ~124 дня walltime для полного backfill, бесплатно.Why this matters: с
house_fias_idна каждом доме можно делать deterministic house-match между listings и target адресом (Tier S — same building), значительно улучшая качество аналогов (#6 House-match приоритет).Changes
backend/data/sql/070_houses_dadata_enrichment.sqlbackend/scripts/backfill_houses_dadata.pybackend/tests/scripts/test_backfill_houses_dadata.py3 файла, +1044 LOC.
Migration 070
4 nullable columns + 3 partial indexes (
IF NOT EXISTSeverywhere, idempotent):house_fias_id text(+ partial idx)cadastral_number(был, +partial idx)dadata_qc_geo integerdadata_qc_house integerdadata_enriched_at timestamptz(+ partial idx WHERE IS NULL — для resume-safe selection)Script logic
Flags:
--limit N(default 100),--batch LABEL,--dry-run,--priority coords|cadnum|both.Resume-safe: WHERE
dadata_enriched_at IS NULL→ следующий запуск пропускает уже обработанные.Tests
Покрывает:
_is_enriched_resultaccept/reject (qc_geo 0/1/2/3, None, no-coords)_run_backfill: qc=0 happy, qc=3 tracking, None result, exception isolation, --dry-run_select_candidates: priority filteringRuff clean. Все DaData API mocked — нет реальных запросов.
Deploy plan
--limit 50 --priority coords --dry-runчтобы убедиться что candidates находит--limit 100 --priority coords(заполнит ~100 coords)/etc/cron.daily/или Celery beat) — daily 100/деньdadata_enriched_atв DB — через 38 дней coords готовы, через 124 дня вся базаFollow-ups (не блокеры)
houses.house_fias_idв_fetch_analogsкак Tier S (same building exact match) — открывает дорогу к #6 House-match priorities.forgejo/workflows/(отдельный PR, после первого manual test)