fix(tradein): /sales-vs-listings street_only не house_linked (Refs #757) (#777)
Some checks failed
Deploy Trade-In / deploy (push) Blocked by required conditions
Deploy Trade-In / changes (push) Successful in 5s
Deploy Trade-In / build-frontend (push) Has been skipped
Deploy Trade-In / test (push) Successful in 24s
Deploy Trade-In / build-backend (push) Has been cancelled

Co-authored-by: bot-backend <bot-backend@gendsgn.local>
Co-committed-by: bot-backend <bot-backend@gendsgn.local>
This commit is contained in:
bot-backend 2026-05-30 16:26:08 +00:00 committed by bot-reviewer
parent 652e0df10f
commit 9954f4962f

View file

@ -1691,7 +1691,8 @@ def get_sales_vs_listings(
deals_with_listings=deals_with_listings,
linkage_rate_pct=linkage_rate_pct,
median_discount_pct=median_discount,
# #721 ADR v3: total_deals>0 здесь (guard `if not rows` выше → _empty).
data_quality="house_linked" if deals_with_listings > 0 else "street_only",
# street_sales_vs_listings матчит по УЛИЦЕ (не по дому, #721 ADR) →
# даже при deals_with_listings>0 это street-level, не house. house_linked НЕ emit'им.
data_quality="street_only" if total_deals > 0 else "no_data",
pairs=pairs,
)