fix(tradein-estimator): ruff lint fixes (RUF046, E501) pre-existing in #507

- Remove redundant int() around round() — RUF046
- Wrap long f-strings in _compute_confidence to stay within 100 chars
- Simplify photo_url expression in _listing_to_analog
This commit is contained in:
lekss361 2026-05-24 14:10:39 +03:00
parent c4f1978ed0
commit fa43ea8dc8

View file

@ -563,7 +563,7 @@ async def estimate_quality(
range_low = int(range_low * repair_coef)
range_high = int(range_high * repair_coef)
median_ppm2 = median_ppm2 * repair_coef
pct = int(round((repair_coef - 1.0) * 100))
pct = round((repair_coef - 1.0) * 100)
repair_note = (
f" Цена скорректирована на состояние ремонта "
f"({_REPAIR_LABEL.get(payload.repair_state, '')} {pct:+d}%)."
@ -1403,7 +1403,7 @@ def _listing_to_analog(row: dict[str, Any]) -> AnalogLot:
price_per_m2=int(row.get("price_per_m2") or 0),
listing_date=row.get("listing_date"),
days_on_market=row.get("days_on_market"),
photo_url=(row.get("photo_urls") or [None])[0] if isinstance(row.get("photo_urls"), list) else None,
photo_url=(row["photo_urls"] or [None])[0] if row.get("photo_urls") else None,
source=row.get("source"),
source_url=row.get("source_url"),
distance_m=int(row["distance_m"]) if row.get("distance_m") is not None else None,