fix(sf-b4): price_per_m2 → price_per_m2_rub (actual column name in objective_lots)

Worker used wrong column name in KPI 3 query — would always raise
UndefinedColumn at runtime and fall back to hardcoded defaults instead
of returning real data. Verified column name via vault
Objective_Data_Source_May17.md + earlier postgres MCP query.

Also resolves merge with hotfix #337 (pilot.py EmailStr drop) — no
actual conflict, just sync with new main.
This commit is contained in:
lekss361 2026-05-18 00:37:03 +03:00
parent e6f3b764a4
commit b0d48164b6

View file

@ -54,7 +54,7 @@ def _query_stats(db: Session) -> dict[str, Any] | None:
row_price = db.execute(
text(
"SELECT"
" COUNT(*) FILTER (WHERE price_per_m2 IS NOT NULL) * 100.0"
" COUNT(*) FILTER (WHERE price_per_m2_rub IS NOT NULL) * 100.0"
" / NULLIF(COUNT(*), 0)"
" FROM objective_lots"
)