b4w ingest e2e test

This commit is contained in:
2026-09-13 12:57:05 +02:00
parent ef07fa5a2e
commit 8440dd2ea7
2 changed files with 49 additions and 6 deletions
+4 -6
View File
@@ -2,7 +2,6 @@ from pathlib import Path
from sqlalchemy.orm import Session
from src.db import get_session
from src.ingest._common import _reader_raw, _upsert
from src.models.b4w import B4wDb, B4wExport, Category, CategoryDb
@@ -64,9 +63,8 @@ def upsert_b4w(
)
def ingest_b4w(path: Path):
def ingest_b4w(path: Path, session: Session):
data = reader_b4w(path)
with get_session() as session:
for row in data:
upsert_b4w(session, row, do_commit=False)
session.commit()
for row in data:
upsert_b4w(session, row, do_commit=False)
session.commit()