From 8dd9155cc79f2abc53e211e27091e9f2bbd0bc95 Mon Sep 17 00:00:00 2001 From: sjbrandenberg Date: Tue, 21 Mar 2023 15:26:28 -0700 Subject: [PATCH] Update earthquake_recovery_db.py --- designsafe_db/earthquake_recovery_db.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/designsafe_db/earthquake_recovery_db.py b/designsafe_db/earthquake_recovery_db.py index 08e1623..1b4551d 100644 --- a/designsafe_db/earthquake_recovery_db.py +++ b/designsafe_db/earthquake_recovery_db.py @@ -37,8 +37,7 @@ def read_sql(*args): if(output=='DataFrame'): try: engine = sqlalchemy.create_engine('mysql+pymysql://dspublic:R3ad0nlY@129.114.52.174:3306/post_earthquake_recovery') - with engine.begin() as con: - data = pd.read_sql_query(sql=text(sql), con=engine) + data = pd.DataFrame(engine.connect().execute(text(sql))) engine.dispose() return(data) except exc.SQLAlchemyError as e: