@@ -341,7 +341,9 @@ def create_and_load_postgres_datetz(conn, table_name):
341
341
from sqlalchemy .engine import Engine
342
342
343
343
metadata = MetaData ()
344
- datetz = Table (table_name , metadata , Column ("DateColWithTz" , DateTime (timezone = True )))
344
+ datetz = Table (
345
+ table_name , metadata , Column ("DateColWithTz" , DateTime (timezone = True ))
346
+ )
345
347
datetz_data = [
346
348
{
347
349
"DateColWithTz" : "2000-01-01 00:00:00-08:00" ,
@@ -565,8 +567,6 @@ def drop_table(
565
567
table_name : str ,
566
568
conn : sqlite3 .Connection | sqlalchemy .engine .Engine | sqlalchemy .engine .Connection ,
567
569
):
568
- import sqlalchemy
569
-
570
570
if isinstance (conn , sqlite3 .Connection ):
571
571
conn .execute (f"DROP TABLE IF EXISTS { sql ._get_valid_sqlite_name (table_name )} " )
572
572
conn .commit ()
@@ -577,12 +577,9 @@ def drop_table(
577
577
with conn .cursor () as cur :
578
578
cur .execute (f'DROP TABLE IF EXISTS "{ table_name } "' )
579
579
else :
580
- try :
581
- with conn .begin () as con :
582
- with sql .SQLDatabase (con ) as db :
583
- db .drop_table (table_name )
584
- except sqlalchemy .exc .ProgrammingError :
585
- pass
580
+ with conn .begin () as con :
581
+ with sql .SQLDatabase (con ) as db :
582
+ db .drop_table (table_name )
586
583
587
584
588
585
def drop_view (
@@ -3974,7 +3971,9 @@ def test_psycopg2_schema_support(postgresql_psycopg2_engine):
3974
3971
con .exec_driver_sql ("CREATE SCHEMA other;" )
3975
3972
3976
3973
schema_public_uuid = create_unique_table_name ("test_schema_public" )
3977
- schema_public_explicit_uuid = create_unique_table_name ("test_schema_public_explicit" )
3974
+ schema_public_explicit_uuid = create_unique_table_name (
3975
+ "test_schema_public_explicit"
3976
+ )
3978
3977
schema_other_uuid = create_unique_table_name ("test_schema_other" )
3979
3978
3980
3979
# write dataframe to different schema's
0 commit comments