def cleanup(me):
if hasattr(me, "_pd_display_maxcolwidth"):
pd.set_option('display.max_colwidth', me._pd_display_maxcolwidth)
engine, session, handler, patchers = me.engine, me.session, me.handler, me.patchers
if me.engine:
if me.session:
try:
me.session.rollback()
me.session.close()
except:
pass
try:
Base.metadata.drop_all(me.engine)
except:
pass
for patcher in patchers:
patcher.stop()
hndls = query_logger.handlers[:]
handler.close()
for h in hndls:
if h is handler:
query_logger.removeHandler(h)
评论列表
文章目录