before claude

This commit is contained in:
Gilles Soulier
2026-01-18 06:26:17 +01:00
parent dc19315e5d
commit 740c3d7516
60 changed files with 3815 additions and 354 deletions

View File

@@ -25,7 +25,12 @@ class ScrapingPipeline:
def __init__(self, config: Optional[AppConfig] = None) -> None:
self.config = config
def process_snapshot(self, snapshot: ProductSnapshot, save_to_db: bool = True) -> Optional[int]:
def process_snapshot(
self,
snapshot: ProductSnapshot,
save_to_db: bool = True,
apply_classification: bool = True,
) -> Optional[int]:
"""
Persiste un snapshot en base si active.
@@ -39,6 +44,8 @@ class ScrapingPipeline:
try:
with get_session(app_config) as session:
repo = ProductRepository(session)
if apply_classification:
repo.apply_classification(snapshot)
product_id = repo.safe_save_snapshot(snapshot)
session.commit()
return product_id