fix(analyze): district KeyError 500 (#994) + revive by-bbox tests #1029
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#1029
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "fix/994-district-keyerror-test-revival"
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?
Live-багфикс (#994) + оживление by-bbox тестов.
БАГ (из уже-смерженного #994): persist-call-site в
analyze_parcelизвлекал district черезresult_payload["district"]["district_name"]— но district-dict без этого ключа (реальные данные: частичный district-lookup) → KeyError ВНЕ best-effort SAVEPOINT (извлечение в call-site, не внутри persist) → 500 на LIVE /analyze. Фикс:.get("district_name")→ None. Поймано оживлением analyze-сьюта.Тест-инфра (сьют был нерабочим — потому баг и прошёл):
layout_tz_pdf.py+trade_in_pdf.py(паттерн report_pdf/snapshot_pdf). Eager top-level импорты делалиapp.mainнеимпортируемым на хостах без native-libs (macOS dev) → ломали СБОР всего api/v1-сьюта. WeasyPrint импортится при реальном рендере PDF.tests/conftest.py: autouse-сбросapp.dependency_overrides(anti-leak).test_parcel_by_bbox.py: моки get_db переведены сpatch()(no-op — FastAPI Depends держит оригинал) наdependency_overrides, явный X-Authenticated-User (RBAC), patch latest_run_dates, +тест last_analysis_date из latest-рана (#994). 5/5 зелёные.⚠️ NOTE: возврат collectability вскрыл PRE-EXISTING рот в др. api/v1-сьютах (analyze/admin/best_layouts: RBAC-header + дрейф ассертов/моков) — это НЕ регрессии данного PR (были uncollectable), трекаются отдельно под suite-rehab + CI test-gate.
Refs #994.