fix(tradein): backfill kn price_per_m2 via sale_graph + peer median (#573) #625
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#625
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "fix/573-kn-price-per-m2-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
Test plan
Closes #573
756 977 NULL-status rows in domrf_kn_flats imported from historical DOM.RF snapshots carry total_area but no price_rub, so the scraper's price_rub/total_area derivation never fires for them. This left 5/8 EKB districts at 0% price_per_m2 coverage and blocked the Limit_District_Median_Partial analytics limitation. Migration 100 adds a three-pass idempotent backfill: 1. price_rub / total_area (sanity net; 0 rows in practice) 2. domrf_kn_sale_graph.price_avg (type='apartments', latest snapshot) via obj_id join — fills 453 606 rows 3. peer median from free/sold/booked flats in the same obj_id — fills 620 more rows After backfill: 61.5% overall coverage (up from 3.7%), all 8 EKB districts get a non-NULL median (7/8 districts reach ≥ 60%). Also tightens the UPSERT: price_per_m2 now uses COALESCE so re-scraping NULL-status flats no longer overwrites a previously backfilled value.