Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
ffm-baseline
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ML
ffm-baseline
Commits
014bedfa
Commit
014bedfa
authored
Sep 02, 2018
by
张彦钊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
如果日记队列顺序没有发生变化,就不更新数据库了
parent
102aea36
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
44 deletions
+1
-44
config.py
config.py
+1
-44
No files found.
config.py
View file @
014bedfa
...
@@ -30,50 +30,7 @@ QUEUE_ONLINE_HOST = 'rm-m5e842126ng59jrv6.mysql.rds.aliyuncs.com'
...
@@ -30,50 +30,7 @@ QUEUE_ONLINE_HOST = 'rm-m5e842126ng59jrv6.mysql.rds.aliyuncs.com'
LOCAL_HOST
=
'rdsmaqevmuzj6jy.mysql.rds.aliyuncs.com'
LOCAL_HOST
=
'rdsmaqevmuzj6jy.mysql.rds.aliyuncs.com'
# import pymysql
# import pandas as pd
# device_id = "16CFD2C4-B965-42C8-8ADD-7BDC22D6CC57"
# city = "wuhan"
# queue_name_list = ["native_queue","nearby_queue","nation_queue","megacity_queue"]
# for i in queue_name_list:
#
# sql = "select {} from device_diary_queue " \
# "where device_id = '{}' and city_id = '{}';".format(i,device_id, city)
#
# db = pymysql.connect(host='rm-m5e842126ng59jrv6.mysql.rds.aliyuncs.com', port=3306, user='doris',passwd='o5gbA27hXHHm',
# db='doris_prod')
# # sql = "select device_id,city_id,native_queue,nearby_queue,nation_queue,megacity_queue,get_diary_time,id from device_diary_queue" \
# # "where device_id = {} and city_id = {};".format(device_id,city)
# cursor = db.cursor()
# cursor.execute(sql)
# result = cursor.fetchall()
# df = pd.DataFrame(list(result))
# print(df.shape)
# df.to_csv("/data2/models/{}.csv".format(i),index=None)
# print("end")
import
pandas
as
pd
queue_name_list
=
[
"native_queue"
,
"nearby_queue"
,
"nation_queue"
,
"megacity_queue"
]
id
=
9454
device_id
=
"16CFD2C4-B965-42C8-8ADD-7BDC22D6CC57"
city_id
=
"wuhan"
a
=
{}
for
i
in
queue_name_list
:
a
[
i
]
=
pd
.
read_csv
(
"/data2/models/native_queue.csv"
)[
"0"
]
.
values
.
tolist
()[
0
]
db
=
pymysql
.
connect
(
host
=
'rm-m5e842126ng59jrv6.mysql.rds.aliyuncs.com'
,
port
=
3306
,
user
=
'doris'
,
passwd
=
'o5gbA27hXHHm'
,
db
=
'doris_prod'
)
sql
=
"update device_diary_queue set {}='{}' where device_id = '{}' and city_id = '{}'"
.
format
\
(
i
,
a
[
i
],
device_id
,
city_id
)
cursor
=
db
.
cursor
()
cursor
.
execute
(
sql
)
db
.
commit
()
db
.
close
()
print
(
"end"
)
# native_queue,nearby_queue,nation_queue,megacity_queue,
# a['native_queue'],a['nearby_queue'],a['nation_queue'],a['megacity_queue'],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment