Не выдавать цену, когда рядом нет ни одного аналога #3537

Merged
lekss361 merged 3 commits from fix/estimator-zero-analogs-no-price into main 2026-09-16 17:16:27 +00:00
2 changed files with 4 additions and 4 deletions
Showing only changes of commit 39af474f44 - Show all commits

View file

@ -4196,9 +4196,7 @@ def _price_from_inputs(
and dkp_raw is not None
and dkp_raw.get("count", 0) >= DEALS_HEADLINE_FALLBACK_MIN_N
and dkp_raw.get("median_ppm2", 0) > 0
and not (
settings.estimate_require_local_evidence and dkp_raw.get("scope") == "city_wide"
)
and not (settings.estimate_require_local_evidence and dkp_raw.get("scope") == "city_wide")
):
median_ppm2 = float(dkp_raw["median_ppm2"])
median_price = int(median_ppm2 * area_m2)

View file

@ -59,7 +59,9 @@ def _run_estimate(
async def _run():
with (
patch("app.services.estimator.settings.estimate_require_local_evidence", require_analogs),
patch(
"app.services.estimator.settings.estimate_require_local_evidence", require_analogs
),
patch("app.services.estimator.geocode", new=AsyncMock(return_value=_make_fake_geo())),
patch("app.services.estimator.dadata_clean_address", new=AsyncMock(return_value=None)),
patch("app.services.estimator.match_house_readonly", return_value=None),