[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:
1 parent
c366361513
commit
951e451ef8
7 files changed
+38
-21
No files matched your search
@@ -14,6 +14,7 @@ URL 규약 (업종을 URL 에서 읽어 결정적으로 동작한다)
|
||||
mock://cafe/cafe-1?channel=naver_place
|
||||
https://mock.test/restaurant/r-1
|
||||
"""
|
||||
from typing import Optional
|
||||
from urllib.parse import parse_qs, urlparse
|
||||
|
||||
from common.category_schema import get_schema
|
||||
@@ -227,7 +228,7 @@ class MockAdapter:
|
||||
return True
|
||||
return parsed.scheme in ("http", "https") and parsed.hostname in _HOSTS
|
||||
|
||||
async def fetch(self, url: str) -> RawSource:
|
||||
async def fetch(self, url: str, category: Optional[PlaceCategory] = None) -> RawSource:
|
||||
"""URL 에서 업종을 읽어 그 업종의 목데이터를 돌려준다.
|
||||
|
||||
업종을 못 읽으면 예외가 아니라 실패 결과(ok=False)로 돌려준다 —
|
||||
|
||||
Reference in new issue
Block a user