3354 active yandex listings on prod (region 66) had street-only addresses like 'улица Горького' — Yandex valuation endpoint can't resolve them. Detail page <title> contains the full address with house number (e.g. 'Екатеринбург, улица Горького, 36'). Backfill script fetches /offer/<id>/ via curl_cffi chrome120 (plain httpx returns CSR shell), parses <title>, updates DB. Smoke verified: 5/5 enriched correctly. Idempotent (skip-recent + ON CONFLICT in downstream sweep). Rate-limited 3s default. --dry-run for safe preview. |
||
|---|---|---|
| .. | ||
| backfill-house-imv.py | ||
| backfill-yandex-addresses-ekb.py | ||
| backfill_001_address_fingerprints.py | ||
| backfill_002_house_sources.sql | ||
| backfill_003_listing_sources.sql | ||
| cian_backfill_all.sh | ||
| probe-confidence-distribution.py | ||
| probe-imv-by-address.py | ||
| README.md | ||
| sweep-yandex-valuation-ekb.py | ||
| upload-cian-cookies.sh | ||
tradein-mvp scripts -- backfill
One-shot manual operator scripts. NOT auto-applied by deploy.yml (which only runs tradein-mvp/backend/data/sql/NN_*.sql).
Order
Run in numbered sequence after PR #470 (matching module) merged:
cd tradein-mvp/backend
export DATABASE_URL="postgresql+psycopg://user:pass@host:5432/tradein"
# 001 -- backfill houses.address_fingerprint (Python, idempotent)
uv run python ../scripts/backfill_001_address_fingerprints.py
# 002 -- backfill house_sources link rows (SQL, idempotent)
psql "${DATABASE_URL/postgresql+psycopg/postgresql}" -f ../scripts/backfill_002_house_sources.sql
# 003 -- backfill listing_sources link rows (SQL, idempotent)
psql "${DATABASE_URL/postgresql+psycopg/postgresql}" -f ../scripts/backfill_003_listing_sources.sql
All scripts idempotent -- re-running is safe (ON CONFLICT DO NOTHING on the SQL; row-level UPDATE WHERE NULL on the Python).
Other scripts
upload-cian-cookies.sh-- one-shot Cian session cookie upload (see inline docs)