REOPENED. _SALES_WINDOW_SQL derived "sales in window" from objective_lots_history snapshots, but history is only ~17 days deep — every currently-sold lot had a sold-snapshot in the window, so window-sales collapsed into the entire cumulative sold stock (Автовокзал 6mo: 33,245 vs real ~2,308). Inflated absorption_rate (~235%/mo with confidence=high), months_of_supply, unit_velocity, liquidity, demand_concentration → contaminated forecast #950/#952. Count window sales directly from objective_lots by contract_date in the window (the real sale date — present on 100% of sold lots: 41,091/41,091). Return contract of _query_sales_window unchanged (units/area/by-room ROLLUP); downstream formulas untouched. Removed the now-dead objective_lots_history JOIN/CTE. Regression test: lots sold outside window (contract_date out of range) not counted (41,091 cumulative vs 2,308 window → absorption 2.35→0.04). 288 tests green. Verification = prod compute_market_metrics(Автовокзал) post-deploy. Refs #949 |
||
|---|---|---|
| .. | ||
| api | ||
| integration | ||
| scrapers | ||
| scripts | ||
| services | ||
| smoke | ||
| sql | ||
| workers | ||
| __init__.py | ||
| conftest.py | ||
| test_admin_weight_profiles.py | ||
| test_concepts_stub.py | ||
| test_gate_verdict.py | ||
| test_health.py | ||
| test_layout_signature.py | ||
| test_layout_tz_pdf.py | ||
| test_nspd_client.py | ||
| test_nspd_sync.py | ||
| test_ping.py | ||
| test_poi_score.py | ||
| test_quarter_dump_lookup.py | ||
| test_rbac.py | ||
| test_sentry_init.py | ||
| test_velocity.py | ||
| test_weight_profiles.py | ||