@@ -285,16 +285,6 @@ def test_dfs_are_equal_for_different_chunksizes(postgresql_table, postgresql_con
285
285
286
286
287
287
def test_upsert (postgresql_table , postgresql_con ):
288
- create_table_sql = (
289
- f"CREATE TABLE public.{ postgresql_table } "
290
- "(c0 varchar NULL PRIMARY KEY,"
291
- "c1 int NULL DEFAULT 42,"
292
- "c2 int NOT NULL);"
293
- )
294
- with postgresql_con .cursor () as cursor :
295
- cursor .execute (create_table_sql )
296
- postgresql_con .commit ()
297
-
298
288
df = pd .DataFrame ({"c0" : ["foo" , "bar" ], "c2" : [1 , 2 ]})
299
289
300
290
with pytest .raises (wr .exceptions .InvalidArgumentValue ):
@@ -369,17 +359,6 @@ def test_upsert(postgresql_table, postgresql_con):
369
359
370
360
371
361
def test_upsert_multiple_conflict_columns (postgresql_table , postgresql_con ):
372
- create_table_sql = (
373
- f"CREATE TABLE public.{ postgresql_table } "
374
- "(c0 varchar NULL PRIMARY KEY,"
375
- "c1 int NOT NULL,"
376
- "c2 int NOT NULL,"
377
- "UNIQUE (c1, c2));"
378
- )
379
- with postgresql_con .cursor () as cursor :
380
- cursor .execute (create_table_sql )
381
- postgresql_con .commit ()
382
-
383
362
df = pd .DataFrame ({"c0" : ["foo" , "bar" ], "c1" : [1 , 2 ], "c2" : [3 , 4 ]})
384
363
upsert_conflict_columns = ["c1" , "c2" ]
385
364
@@ -437,16 +416,6 @@ def test_upsert_multiple_conflict_columns(postgresql_table, postgresql_con):
437
416
438
417
439
418
def test_insert_ignore_duplicate_columns (postgresql_table , postgresql_con ):
440
- create_table_sql = (
441
- f"CREATE TABLE public.{ postgresql_table } "
442
- "(c0 varchar NULL PRIMARY KEY,"
443
- "c1 int NULL DEFAULT 42,"
444
- "c2 int NOT NULL);"
445
- )
446
- with postgresql_con .cursor () as cursor :
447
- cursor .execute (create_table_sql )
448
- postgresql_con .commit ()
449
-
450
419
df = pd .DataFrame ({"c0" : ["foo" , "bar" ], "c2" : [1 , 2 ]})
451
420
452
421
wr .postgresql .to_sql (
@@ -501,17 +470,6 @@ def test_insert_ignore_duplicate_columns(postgresql_table, postgresql_con):
501
470
502
471
503
472
def test_insert_ignore_duplicate_multiple_columns (postgresql_table , postgresql_con ):
504
- create_table_sql = (
505
- f"CREATE TABLE public.{ postgresql_table } "
506
- "(c0 varchar NULL PRIMARY KEY,"
507
- "c1 int NOT NULL,"
508
- "c2 int NOT NULL,"
509
- "UNIQUE (c1, c2));"
510
- )
511
- with postgresql_con .cursor () as cursor :
512
- cursor .execute (create_table_sql )
513
- postgresql_con .commit ()
514
-
515
473
df = pd .DataFrame ({"c0" : ["foo" , "bar" ], "c1" : [1 , 2 ], "c2" : [3 , 4 ]})
516
474
insert_conflict_columns = ["c1" , "c2" ]
517
475
0 commit comments