Skip to content

Commit

Permalink
allow_overwrite is False -> on_conflict_do_nothing
Browse files Browse the repository at this point in the history
Signed-off-by: Victor Garcia Reolid <[email protected]>
  • Loading branch information
victorgarcia98 committed Jul 17, 2024
1 parent 55b11c6 commit 10f6527
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion timely_beliefs/beliefs/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def add_to_session(
beliefs_data_frame: "BeliefsDataFrame",
expunge_session: bool = False,
allow_overwrite: bool = False,
bulk_save_objects: bool = False,
bulk_save_objects: bool = True,
commit_transaction: bool = False,
):
"""Add a BeliefsDataFrame as timed beliefs to a database session.
Expand Down Expand Up @@ -308,6 +308,8 @@ def add_to_session(
],
set_=dict(event_value=smt.excluded.event_value),
)
else:
smt = smt.on_conflict_do_nothing()

session.execute(smt)

Expand Down

0 comments on commit 10f6527

Please sign in to comment.