fix(backfill): drop nonexistent kadastr_num column from listings SELECT #1732
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#1732
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "fix/backfill-kadastr-column"
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
python -m scripts.backfill_listing_sources(the house_id_fk backlog drainer) crashed on every run:UndefinedColumn: column "kadastr_num" does not exist. The column was dropped indata/sql/094_cadastral_unify.sql(0% data); the script's listings SELECT still referenced it.Fix
scripts/backfill_listing_sources.py: removedkadastr_numfrom the SELECT, theListingRowdataclass, and the row mapping. The downstream matcher call usedcadastral_number or row.kadastr_num(the fallback was already dead — 0% data) → now justcadastral_number.building_cadastral_numberstill passed;match_or_create_houseusesbuilding_cadastral_number or cadastral_number, so no behavior loss.Why it matters (overnight fill)
This script drains the static house_id_fk backlog (~16k avito + ~14k cian active rows unlinked). With #1727 now linking new/re-scraped rows in realtime, this clears the existing pool. Broken since the 094 migration.
Test plan
pytest -k "backfill or listing_source"→ 196 passed; ruff cleanpython -m scripts.backfill_listing_sourcesruns end-to-end → active avito/cian house_id_fk climbsRefs #1188