|
@@ -116,8 +116,9 @@ def get_data_fromMysql(params):
|
|
|
#数据库读取实测气象
|
|
|
engine = create_engine(f"mysql+pymysql://{mysql_conn}")
|
|
|
# 定义SQL查询
|
|
|
- env_df = pd.read_sql_query(query_sql, engine)
|
|
|
- return env_df
|
|
|
+ with engine.connect() as conn:
|
|
|
+ df = pd.read_sql_query(query_sql, conn)
|
|
|
+ return df
|
|
|
|
|
|
|
|
|
def insert_pickle_model_into_mongo(model, args):
|