[fix] solution/backend: 네이버 플레이스 수집이 음식점·카페 요금표를 통째로 반려 — 업종별 unit key 분기

_to_unit_facts() 가 업종을 안 가리고 room_type·weekday_price/weekend_price 로만 냈다.
그 key 는 숙박 스키마에만 있어서, 음식점·카페·클리닉은 메뉴/프로그램 요금표가
FACT_INVALID_KEY 로 전량 거부됐다(실측: "도플로" fact 19건 중 19건 반려).

- naver_place_adapter.py: _UNIT_NAME_KEY·_UNIT_PRICE_KEY 로 업종별 key 매핑
  (숙박 room_type/weekday·weekend_price, 카페·음식점 menu_name/menu_price,
  클리닉 program_name/price_adult)
- SourceAdapter.fetch() 계약에 category 파라미터 추가, 어댑터 5개 시그니처 반영
- collect_service.py: fetch_one() 에 place.category 전달

검증: 재수집 후 stored 0 → 35(음식점), test_collector·test_category_schema·
test_fact_api·test_tour_api_adapter 173 passed
This commit is contained in:
minaChoi committed 2026-09-23 13:17:28 +09:00
1 parent c366361513
commit 951e451ef8
7 files changed
+38 -21

No files matched your search

+3 -3
View File
@@ -412,7 +412,7 @@ async def coverage(place, place_id: str) -> dict:
}
async def fetch_one(link):
async def fetch_one(link, category=None):
"""링크 하나를 긁는다. 실패해도 예외를 던지지 않는다 — 나머지 링크가 살아야 한다."""
try:
adapter = REGISTRY.get_adapter(link.url)
@@ -421,7 +421,7 @@ async def fetch_one(link):
LOG.w(f"[collect] 어댑터 없음 — 건너뜀 {link.url}: {type(ex).__name__}")
return None, "no_adapter"
try:
source = await adapter.fetch(link.url)
source = await adapter.fetch(link.url, category)
except Exception as ex:
collect_diagnostics.note_issue("fetch", link.url, ex)
return None, "failed"
@@ -638,7 +638,7 @@ async def _run_collect(job: dict) -> dict:
f"남은 링크 {fetch_stat['skipped_enough']}건 크롤링 생략")
break
source, outcome = await fetch_one(link)
source, outcome = await fetch_one(link, PlaceCategory(place.category))
fetch_stat[outcome] += 1
if source is None:
continue