fix(tradein): surface same-building comps as analogs when anchor fires (#694) #708
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#708
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "fix/694-show-anchor-analogs"
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
Mechanism
_fetch_anchor_compsтянет display-поля (address/source/source_url/price_rub/listing_date/days_on_market/photo_urls/lat/lon) в тирах A/C.anchor_tier!=None→ analogs изanchor_comps_usedчерез_anchor_comp_to_analog(robust: price_rub=ppm²×area при отсутствии). Радиусный путь без якоря не тронут.Test plan
pytest tests/test_same_building_anchor.py→ 44 passed (+3).Closes #694
Surface same-building comps as analogs when anchor fires (#694). Transparency fix: when SB anchor mutates headline, displayed analogs now come from anchor_comps_used (the comps the headline is built on) via _anchor_comp_to_analog, instead of cheaper/empty radius analogs. Verified: NO pricing regression (only analogs_lots display changes; median/expected_sold untouched). _anchor_comp_from_row = DRY refactor (was inlined both tiers) adding display cols to SELECT (standard listings cols), .get()-robust. _anchor_comp_to_analog defensive: price_rub from row else ppm2*area else ppm2 (no zero/crash), safe photo_urls[0], null-safe. Only estimator.py PR this pass, 0 conflicts, +66 tests. MINOR (non-blocking): price_rub=ppm2 fallback when area+price_rub both absent shows per-m2 as total ? real listings carry both, hits only mocks/legacy. APPROVE.