feat(tradein-estimator): exclude rosreestr deals from output (#504)
All checks were successful
Deploy Trade-In / changes (push) Successful in 6s
Deploy Trade-In / build-frontend (push) Has been skipped
Deploy Trade-In / build-backend (push) Successful in 38s
Deploy Trade-In / deploy (push) Successful in 36s

This commit is contained in:
lekss361 2026-05-24 10:52:55 +00:00
parent 8fc309d9ad
commit 6bfa686f16

View file

@ -402,8 +402,12 @@ async def estimate_quality(
) -> AggregatedEstimate:
"""Главная функция — оценка квартиры по реальным данным.
NOTE 2026-05-24: rosreestr_deals temporarily NOT included in actual_deals
output (they contain ДДУ first-market data that skews secondary-market
median). See Decision_TradeIn_DataQuality_8PR_Roadmap.
Returns:
AggregatedEstimate с estimate_id, медианой, диапазоном, аналогами, сделками.
AggregatedEstimate с estimate_id, медианой, диапазоном, аналогами.
"""
# 1. Geocode
geo: GeocodeResult | None = None
@ -585,11 +589,11 @@ async def estimate_quality(
except Exception as exc:
logger.warning("cian_valuation: lookup failed (graceful): %s", exc)
# 5. Deals — фактические сделки за период
deals = _fetch_deals(
db, lat=geo.lat, lon=geo.lon, rooms=payload.rooms, area=payload.area_m2,
radius_m=DEFAULT_RADIUS_M,
)
# 5. Deals — отключены 2026-05-24 (см. Decision_TradeIn_DataQuality_8PR_Roadmap).
# rosreestr_deals содержит ДДУ первичного рынка (177-200 К/м²), что искажает
# оценку вторички (~114 К/м²). Возвращаемся к этому когда отделим вторичные
# сделки от ДДУ в источнике.
deals: list[dict[str, Any]] = []
# 6. Сохраняем в trade_in_estimates
estimate_id = uuid4()