feat(tradein-sweep): --require-house-number filter (default on) #536
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#536
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/tradein-sweep-house-number-filter"
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
, \d+)--no-require-house-numberto include all (e.g. for diagnostics)Why
Live observation during full sweep (PR #533 follow-up): first 6 addresses returned 0 items each — all were bare street names ('Академическая улица', 'Александровский проспект', ...). Yandex valuation endpoint resolves only to specific buildings, not streets. Only 123/583 (21%) of
listings.addressvalues contain a house number.Sweep at 24s/address: 583 = 3.9h vs 123 = 50min. ~4.7× speedup, same data.
Followup
addresscolumn) is upstream data-quality work — separate issue.Deep Code Review — verdict
Summary
tradein-mvp/scripts/)5ee8a20A. Security
house_num_clauseis a constant string (no user input);:daysparam binding preserved. f-string only interpolates the literal clause. OK.B. Correctness
address ~ ',\s*\d+'correctly matches the documented examples (, 12,, 12к3,, 5Б,, 106). Correctly rejects bare'Александровский проспект'(no comma) and street-only'Академическая улица'.--skip-recent-days >0and=0branches receive the filter symmetrically.--addresssingle-mode bypasses the filter (correct: explicit override).',\s*\d+'produces correct POSIX regex.(:days || ' days')::intervalcast is pre-existing, not introduced here — no new psycopg v3 CAST trap.C. Performance
SELECT DISTINCT; an extra regex predicate onaddressis negligible. Cuts sweep wall-time 3.9h → 50min (4.7× speedup). Sound tradeoff.D. Conventions / Architecture
--flag/--no-flagtoggle pair viadest=/action=store_true|store_falsewithdefault=Trueis the standard Python idiom for default-on boolean flags. OK.E. Backward-compat
(default on)and body explains the 583→123 cut.--no-require-house-numberexplicitly preserves old behavior for diagnostics. Acceptable for an operator tool.F. Tests
--limit Ndry-run.G. Edge cases noted (not blocking)
, д. 5) would not match — extremely uncommon inlistings.addressdata (sample examples use bare, 106).Куйбышева 106without comma) would not match — but per the file docstring example data is comma-delimited.Verdict: APPROVE — merging.
Followup nit (non-blocking): trim the "OR end with a digit token" claim from the docstring or extend the regex to
,\s*\d+|\s\d+\s*$.