feat(yandex): map rich entity fields (predictedPrice, seller, listing_date, trend, metro) #1725
No reviewers
Labels
No labels
admin
analytics
auth
automation
bug
business
chore
ci
compliance
data
data-moat
docs
duplicate
dx
enhancement
Fable 5 ревью
feedback/max
generative
GG-форсайт
needs-discussion
needs-human
observability
pause-bots
performance
priority/p0
priority/p1
priority/p2
priority/p3
scope/backend
scope/db
scope/devops
scope/frontend
scope/qa
scrapers
security
site-finder
stage/1
stage/2
status/blocked
status/done
status/needs-analysis
status/needs-fix
status/qa
status/ready
status/review
status/wip
tech-debt
tradein
ux
week ревью 1
wontfix
вторичка
ИРД
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lekss361/gendesign#1725
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/yandex-rich-fields"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Yandex gate-API entities expose ~90 fields; we mapped ~11. This adds the high-value ones — most notably Yandex's own per-offer valuation (
predictedPrice). Verified field paths on live gate-API this session.Mapping (yandex_realty.py
_entity_to_lot)creationDate→listing_date+days_on_market(clamped ≥0) +publish_datedescription→descriptionauthor.categoryOWNER→is_homeowner, AGENCY/AGENT→is_pro_seller+agency_name(org/agentName)predictedPrice.predictedPrice.{value,min,max}→ newpredicted_price_rub/_min/_maxprice.trend→ newprice_trend;price.previous→ newprice_previous_rublocation.metroList[]→metro_stationsjsonb;offerId→yandex_offer_idbase.py (shared — additive only, verified gaps)
save_listingswas silently dropping fields even for existing columns:description&agency_namewere in no INSERT/UPDATE at all;days_on_marketmissing from UPDATE;publish_date/yandex_offer_idnot wired. All added viaCOALESCE(EXCLUDED.x, listings.x)so non-yandex scrapers leaving them NULL never wipe stored values. New columns added to ScrapedLot + INSERT/VALUES/UPDATE.Migration
data/sql/121_yandex_rich_fields.sql— idempotentADD COLUMN IF NOT EXISTSpredicted_price_rub/_min/_max, price_trend, price_previous_rub. Auto-applies on deploy.Test plan
pytestyandex+base: 67 passed; broad save_listings regression 39 passed; +13 (yandex_valuation/matching savepoint); ruff cleanSELECT count(*) FILTER(WHERE predicted_price_rub IS NOT NULL), count(*) FILTER(WHERE description IS NOT NULL) FROM listings WHERE source='yandex'climb after a sweepRefs #1658