fix(scraper-kit/yandex): full-load on_bucket отдаёт список лотов бакета, а не int (#3375) #3378
No reviewers
Labels
No labels
Fable 5 ревью
GG-форсайт
admin
analytics
auth
automation
bug
business
chore
ci
compliance
data
data-moat
docs
duplicate
dx
enhancement
feedback/max
generative
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lekss361/gendesign#3378
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "fix/3375-yandex-fullload-on-bucket-contract"
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?
Closes #3375.
Дефект.
run_yandex_full_load._on_bucket(bucket_key, lots, complete)делаетsave_listings(db, lots),unique_fetched += len(lots),record_yandex_price_history(db, lots)— это ЕДИНСТВЕННЫЙ канал сохранения в yandex full-load (результатfetch_all_secondaryотбрасывается). Провайдер yandex звалon_bucket(bucket_key, len(seen), not capped)— int вместо списка →TypeError: object of type 'int' has no len(), лоты не сохранялись.Фикс. В
providers/yandex/serp.py_leaf/_degradedкопятbucket_lotsв тех же ветках, где лот кладётся в общийseen(только новые →unique_fetchedчестен), и отдают список во все 3 вызоваon_bucket— как у cian/avito (on_bucket(bucket_key, bucket_lots, complete)). Других int-вызывающих нет (grep "on_bucket("— 6 вызовов: 3 yandex + cian/avito списки; у domclick своего нет)._mark_bucket/containment/scheduler не тронуты.Тесты. Parity-фикстура
_StubbedYandexScraper— настоящийfetch_all_secondary → _walk_price_range → _leaf, замокан только gate-JSON;test_yandex_full_load_saves_lot_list_from_real_providerпроверяетisinstance(lots, list)+ScrapedLotв каждомsave_listingsиunique_fetched == call_count > 0. Переименован вводивший в заблуждение_count: int→_lotsв старых тестах.Фальсификация (
git apply -Rхунка serp.py):TypeError: object of type 'int' has no len()— 1 failed. Восстановлено — зелено.Прогоны:
-k yandex373 passed (rc=0); полный backend5476 passed, 35 skipped(rc=0).Приёмка на проде (открытая, до 2026-09-13): первый yandex full-load после деплоя —
counters.unique_fetched > 0и ростlistingsпо source=yandex за окно прогона, безTypeErrorв логах.