Spaces:
Running
Running
sghorbal
commited on
Commit
·
92e269c
1
Parent(s):
52e0bc6
improve match ingestion
Browse files- src/service/match.py +3 -1
src/service/match.py
CHANGED
|
@@ -133,7 +133,9 @@ def insert_batch_matches(db: Session, raw_matches: List[Dict], on_conflict_do_no
|
|
| 133 |
raw_match=raw_match.model_dump(exclude_unset=True) if isinstance(raw_match, RawMatch) else raw_match,
|
| 134 |
on_conflict_do_nothing=on_conflict_do_nothing,
|
| 135 |
)
|
| 136 |
-
|
|
|
|
|
|
|
| 137 |
except IntegrityError as e:
|
| 138 |
nb_errors += 1
|
| 139 |
logger.error(f"Error inserting match: {e}")
|
|
|
|
| 133 |
raw_match=raw_match.model_dump(exclude_unset=True) if isinstance(raw_match, RawMatch) else raw_match,
|
| 134 |
on_conflict_do_nothing=on_conflict_do_nothing,
|
| 135 |
)
|
| 136 |
+
|
| 137 |
+
if match.id is not None:
|
| 138 |
+
matches.append(match)
|
| 139 |
except IntegrityError as e:
|
| 140 |
nb_errors += 1
|
| 141 |
logger.error(f"Error inserting match: {e}")
|