Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bh2smith committed Nov 27, 2024
1 parent c2dfc8a commit 9f7c9cd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/unit/destinations_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def test_upsert(self):

drop_table(pg_dest.engine, table_name)
# This upsert would create table (since it doesn't exist yet)
pg_dest.upsert((df1, {}))
pg_dest.insert((df1, {}), on_conflict="update")
self.assertEqual(
[{"id": 1, "value": "alice"}, {"id": 2, "value": "bob"}],
select_star(pg_dest.engine, table_name),
Expand All @@ -237,7 +237,7 @@ def test_upsert(self):
""",
)
# This would insert with no conflict or update.
pg_dest.upsert((df2, {}))
pg_dest.insert((df2, {}), on_conflict="update")
self.assertEqual(
[
{"id": 1, "value": "alice"},
Expand All @@ -248,11 +248,12 @@ def test_upsert(self):
select_star(pg_dest.engine, table_name),
)
# overwrite some columns with max
pg_dest.upsert(
pg_dest.insert(
(
pd.DataFrame({"id": [3, 4, 5], "value": ["max", "max", "erik"]}),
{},
)
),
on_conflict="update",
)
self.assertEqual(
[
Expand Down

0 comments on commit 9f7c9cd

Please sign in to comment.