File tree 1 file changed +4
-12
lines changed
1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -251,7 +251,6 @@ def create_and_load_postgres_datetz(conn):
251
251
Table ,
252
252
insert ,
253
253
)
254
- from sqlalchemy .engine import Engine
255
254
256
255
metadata = MetaData ()
257
256
datetz = Table ("datetz" , metadata , Column ("DateColWithTz" , DateTime (timezone = True )))
@@ -264,17 +263,10 @@ def create_and_load_postgres_datetz(conn):
264
263
},
265
264
]
266
265
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 )
278
270
279
271
# "2000-01-01 00:00:00-08:00" should convert to
280
272
# "2000-01-01 08:00:00"
You can’t perform that action at this time.
0 commit comments