fix(yandex-valuation): off-by-one cell index in _parse_row_cells #552
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#552
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "fix/tradein-yandex-cell-off-by-one"
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
Real Yandex
.OffersArchiveSearchOffers__rowlayout (curl_cffi probe 2026-05-24):cell[0]= photo (empty text)cell[1]= title — area + rooms + floor jammed:"48,5 м², 1-комнатная19 этаж"cell[2..5]= prices, dates, status (unchanged from PR #544)PR #544 read area+rooms from cell[0] and floor from cell[1] → 0% fill for all three fields on 138 live rows. This PR reads everything from cell[1].
Verified locally before push
Tests
Full sweep performed
After applying locally: 5077 rows / 102 distinct houses / 98.4% plausible area.
Deep Code Review — PR #552 verdict
Summary
Cross-file impact
_parse_row_cellshas a single internal caller (_parse_history_itemsline 301). No external API/DB schema change._parse_item_text(chunked-text fallback) unchanged — operates on full text, unaffected by cell-index shift.if len(cells) < 5predates this PR; safe givencell_texts[1]access is guarded byif len(cell_texts) > 1.Correctness verification
Real Yandex layout per probe:
cell[0]=photo (empty),cell[1]="48,5 м², 1-комнатная19 этаж"(jammed). Walked each regex against the jammed string:RE_ITEM_AREA(?<!\d)(\d{2,4}(?:[.,]\d{1,2})?)\s*м²→ matches48,5 м²→ area=48.5 ✓RE_ITEM_ROOMS(\d+)\s*-\s*комнатн→ matches1-комнатн→ rooms=1 ✓ (no false-match on19)RE_ITEM_FLOOR(\d+)\s*этажgreedy → consumes19then matchesэтаж→ floor=19 ✓ (NOT just9—\s*only allows whitespace, regex engine finds longest leftmost match anchored atэтаж)"Студия 25 м²5 этаж"—RE_ITEM_STUDIOmatches, area=25, floor=5 ✓Test fixtures (2 DOM rows + studio) updated to mirror real layout, including empty photo cell at [0].
Minor (Low — non-blocking)
_parse_history_itemsdocstring (lines 289-291) still documents the OLD layout:[0] area+rooms, [1] floor, [2] start_price+ppm2, .... Consider updating in a followup to[0] photo, [1] title (area+rooms+floor jammed), [2] start_price+ppm2, [3] last_price+ppm2, [4] publish_date+exposure, [5] status/removed_dateto prevent confusing the next reader (the body of_parse_row_cellsgot the correct comment, but the parent docstring still references PR #544's incorrect mapping).Positive
Reversibility / blast radius