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:
parent
c4f1978ed0
commit
fa43ea8dc8
1 changed files with 2 additions and 2 deletions
|
|
@ -563,7 +563,7 @@ async def estimate_quality(
|
||||||
range_low = int(range_low * repair_coef)
|
range_low = int(range_low * repair_coef)
|
||||||
range_high = int(range_high * repair_coef)
|
range_high = int(range_high * repair_coef)
|
||||||
median_ppm2 = median_ppm2 * 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 = (
|
repair_note = (
|
||||||
f" Цена скорректирована на состояние ремонта "
|
f" Цена скорректирована на состояние ремонта "
|
||||||
f"({_REPAIR_LABEL.get(payload.repair_state, '')} {pct:+d}%)."
|
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),
|
price_per_m2=int(row.get("price_per_m2") or 0),
|
||||||
listing_date=row.get("listing_date"),
|
listing_date=row.get("listing_date"),
|
||||||
days_on_market=row.get("days_on_market"),
|
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=row.get("source"),
|
||||||
source_url=row.get("source_url"),
|
source_url=row.get("source_url"),
|
||||||
distance_m=int(row["distance_m"]) if row.get("distance_m") is not None else None,
|
distance_m=int(row["distance_m"]) if row.get("distance_m") is not None else None,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue