Compare commits
No commits in common. "c6a5cecb33fb1585d821d360424eda5666eb95b5" and "840d64a4a090e879bf7fa6c77f47d913f874f3d5" have entirely different histories.
c6a5cecb33
...
840d64a4a0
1 changed files with 2 additions and 14 deletions
|
|
@ -677,16 +677,8 @@ def save_detail_enrichment(db: Session, e: DetailEnrichment) -> bool:
|
||||||
|
|
||||||
Returns True если строка обновлена, False если listing не найден.
|
Returns True если строка обновлена, False если listing не найден.
|
||||||
Устанавливает detail_enriched_at=NOW().
|
Устанавливает detail_enriched_at=NOW().
|
||||||
|
House-level поля (passenger_elevators, has_concierge, closed_yard,
|
||||||
house_type СОХРАНЯЕТСЯ (уже нормализован парсером → канон panel/brick/monolith/
|
total_floors_house, house_type) игнорируются — canonical из Houses Catalog (Stage 2c).
|
||||||
monolith_brick/block/wood) — нужен estimator soft-penalty по типу дома.
|
|
||||||
house_catalog_url СОХРАНЯЕТСЯ в listings.house_url (линковка дома); отдельной
|
|
||||||
house_catalog_url колонки нет. house_type — COALESCE existing-first (не затираем
|
|
||||||
canonical из Houses Catalog Stage 2c); house_url — new-first additive (avito-owned
|
|
||||||
поле, нет конкурирующего canonical-писателя).
|
|
||||||
Остальные house-level поля (passenger_elevators, cargo_elevators, has_concierge,
|
|
||||||
closed_yard, total_floors_house) по-прежнему опускаются — нет колонок в listings,
|
|
||||||
canonical приходит из Houses Catalog Stage 2c (отдельный follow-up).
|
|
||||||
"""
|
"""
|
||||||
result = db.execute(
|
result = db.execute(
|
||||||
text("""
|
text("""
|
||||||
|
|
@ -721,8 +713,6 @@ def save_detail_enrichment(db: Session, e: DetailEnrichment) -> bool:
|
||||||
total_floors = COALESCE(:total_floors, total_floors),
|
total_floors = COALESCE(:total_floors, total_floors),
|
||||||
repair_state = COALESCE(:repair_state, repair_state),
|
repair_state = COALESCE(:repair_state, repair_state),
|
||||||
price_rub = COALESCE(:price_rub, price_rub),
|
price_rub = COALESCE(:price_rub, price_rub),
|
||||||
house_type = COALESCE(house_type, :house_type),
|
|
||||||
house_url = COALESCE(:house_catalog_url, house_url),
|
|
||||||
detail_enriched_at = NOW()
|
detail_enriched_at = NOW()
|
||||||
WHERE source = 'avito' AND source_id = :item_id
|
WHERE source = 'avito' AND source_id = :item_id
|
||||||
"""),
|
"""),
|
||||||
|
|
@ -760,8 +750,6 @@ def save_detail_enrichment(db: Session, e: DetailEnrichment) -> bool:
|
||||||
"total_floors": e.total_floors,
|
"total_floors": e.total_floors,
|
||||||
"repair_state": e.repair_state,
|
"repair_state": e.repair_state,
|
||||||
"price_rub": e.price_rub,
|
"price_rub": e.price_rub,
|
||||||
"house_type": e.house_type,
|
|
||||||
"house_catalog_url": e.house_catalog_url,
|
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
db.commit()
|
db.commit()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue