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: