From 1a8494e6315457036ce5fb512943e9b33b5ee41e Mon Sep 17 00:00:00 2001 From: Your Name <you@example.com> Date: Tue, 25 Jun 2019 12:27:48 +0800 Subject: [PATCH] bug fix --- eda/esmm/Model_pipline/predict.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eda/esmm/Model_pipline/predict.py b/eda/esmm/Model_pipline/predict.py index 2d02a2e4..7e399f21 100644 --- a/eda/esmm/Model_pipline/predict.py +++ b/eda/esmm/Model_pipline/predict.py @@ -213,8 +213,8 @@ def update_or_insert(df2,queue_name): cur = con.cursor() try: for i in range(0, device_count): - query = """INSERT INTO esmm_device_diary_queue_test (device_id, city_id, time,%s) VALUES(%s, %s, %s, %s) \ - ON DUPLICATE KEY UPDATE device_id=%s, city_id=%s, time=%s, %s=%s""" % (queue_name, df2.device_id[i],df2.city_id[i], df2.time[i], df2[queue_name][i], df2.device_id[i], df2.city_id[i], df2.time[i], queue_name, df2[queue_name][i]) + query = """INSERT INTO esmm_device_diary_queue_test (device_id, city_id, time,%s) VALUES('%s', '%s', '%s', '%s') \ + ON DUPLICATE KEY UPDATE device_id='%s', city_id='%s', time='%s', %s='%s'""" % (queue_name, df2.device_id[i],df2.city_id[i], df2.time[i], df2[queue_name][i], df2.device_id[i], df2.city_id[i], df2.time[i], queue_name, df2[queue_name][i]) print(query) cur.execute(query) con.commit() -- 2.18.0