Skip to content

Commit 2dfe32c

Browse files
committed
Don't special case for Engine
1 parent 3edbcb0 commit 2dfe32c

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

pandas/tests/io/test_sql.py

+4-12
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,6 @@ def create_and_load_postgres_datetz(conn):
251251
Table,
252252
insert,
253253
)
254-
from sqlalchemy.engine import Engine
255254

256255
metadata = MetaData()
257256
datetz = Table("datetz", metadata, Column("DateColWithTz", DateTime(timezone=True)))
@@ -264,17 +263,10 @@ def create_and_load_postgres_datetz(conn):
264263
},
265264
]
266265
stmt = insert(datetz).values(datetz_data)
267-
if isinstance(conn, Engine):
268-
with conn.connect() as conn:
269-
with conn.begin():
270-
datetz.drop(conn, checkfirst=True)
271-
datetz.create(bind=conn)
272-
conn.execute(stmt)
273-
else:
274-
with conn.begin():
275-
datetz.drop(conn, checkfirst=True)
276-
datetz.create(bind=conn)
277-
conn.execute(stmt)
266+
with conn.begin():
267+
datetz.drop(conn, checkfirst=True)
268+
datetz.create(bind=conn)
269+
conn.execute(stmt)
278270

279271
# "2000-01-01 00:00:00-08:00" should convert to
280272
# "2000-01-01 08:00:00"

0 commit comments

Comments
 (0)