fix(tradein): sber series fallback continues on error + benchmark gated to ЕКБ region (#794 review)
This commit is contained in:
parent
3485b977f1
commit
468bdb052b
2 changed files with 30 additions and 27 deletions
|
|
@ -965,8 +965,8 @@ def _load_sber_index_series(db: Session, *, region: str) -> dict[date, float]:
|
||||||
.all()
|
.all()
|
||||||
)
|
)
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
logger.warning("sber_price_index lookup failed (graceful, no-op): %s", exc)
|
logger.warning("sber_price_index lookup failed for %s (graceful): %s", dash, exc)
|
||||||
return {}
|
continue
|
||||||
if rows:
|
if rows:
|
||||||
return {r["period_month"]: float(r["index_value_rub_m2"]) for r in rows}
|
return {r["period_month"]: float(r["index_value_rub_m2"]) for r in rows}
|
||||||
return {}
|
return {}
|
||||||
|
|
|
||||||
|
|
@ -380,6 +380,9 @@ async def pull_sber_indices(
|
||||||
latest_month.isoformat(),
|
latest_month.isoformat(),
|
||||||
latest_val,
|
latest_val,
|
||||||
)
|
)
|
||||||
|
# our listings median is ЕКБ-only →
|
||||||
|
# compare only against Свердловская обл. (REF_AREA 66)
|
||||||
|
if ref_area == "66":
|
||||||
# Task B: best-effort reconciliation to our scrape-median asking ppm²
|
# Task B: best-effort reconciliation to our scrape-median asking ppm²
|
||||||
try:
|
try:
|
||||||
our_median = db.execute(
|
our_median = db.execute(
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue