Compare commits
No commits in common. "635851a71c65a9f3801470a31b0e7cc87be657fb" and "8f9c11a45fa766c12a7df99f0eab2bfbdff2cfed" have entirely different histories.
635851a71c
...
8f9c11a45f
2 changed files with 5 additions and 10 deletions
|
|
@ -189,15 +189,12 @@ def _to_bigint(raw: Any) -> int | None:
|
||||||
|
|
||||||
|
|
||||||
def _predicted_prices(entity: dict[str, Any]) -> tuple[int | None, int | None, int | None]:
|
def _predicted_prices(entity: dict[str, Any]) -> tuple[int | None, int | None, int | None]:
|
||||||
"""Extract (value, min, max) from entity.predictions.predictedPrice.
|
"""Extract (value, min, max) from entity.predictedPrice.predictedPrice.
|
||||||
|
|
||||||
Yandex's own per-offer valuation. The gate-API nests it under
|
Yandex's own per-offer valuation. Fields are strings (e.g. "7554000").
|
||||||
``predictions.predictedPrice`` (NOT ``predictedPrice.predictedPrice`` —
|
Returns (None, None, None) when the nested path is absent.
|
||||||
that key does not exist; verified live 2026-06-18 against the gate-API).
|
|
||||||
Fields are strings (e.g. "7554000"). Returns (None, None, None) when the
|
|
||||||
nested path is absent (e.g. novostroyki offers carry no valuation).
|
|
||||||
"""
|
"""
|
||||||
outer = entity.get("predictions") or {}
|
outer = entity.get("predictedPrice") or {}
|
||||||
inner = outer.get("predictedPrice") or {}
|
inner = outer.get("predictedPrice") or {}
|
||||||
if not isinstance(inner, dict):
|
if not isinstance(inner, dict):
|
||||||
return None, None, None
|
return None, None, None
|
||||||
|
|
|
||||||
|
|
@ -114,9 +114,7 @@ _ENTITY_RICH_OWNER: dict = {
|
||||||
"trend": "DECREASED",
|
"trend": "DECREASED",
|
||||||
"previous": 7500000,
|
"previous": 7500000,
|
||||||
},
|
},
|
||||||
# Real gate-API nests valuation under predictions.predictedPrice (verified
|
"predictedPrice": {"predictedPrice": {"value": "7554000", "min": "7100000", "max": "8000000"}},
|
||||||
# live 2026-06-18) — NOT predictedPrice.predictedPrice.
|
|
||||||
"predictions": {"predictedPrice": {"value": "7554000", "min": "7100000", "max": "8000000"}},
|
|
||||||
"area": {"value": 48.0},
|
"area": {"value": 48.0},
|
||||||
"roomsTotal": 2,
|
"roomsTotal": 2,
|
||||||
"floorsOffered": [5],
|
"floorsOffered": [5],
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue