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
acce07e8
Commit
acce07e8
authored
Sep 02, 2018
by
张彦钊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add test
parent
877ac1ae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
11 deletions
+16
-11
testCases.py
local/testCases.py
+16
-11
No files found.
local/testCases.py
View file @
acce07e8
...
@@ -39,10 +39,8 @@ def get_local_device():
...
@@ -39,10 +39,8 @@ def get_local_device():
df
.
to_csv
(
'/Users/mac/utils/test_device_city_id.csv'
,
index
=
None
)
df
.
to_csv
(
'/Users/mac/utils/test_device_city_id.csv'
,
index
=
None
)
print
(
1
)
print
(
1
)
def
save_queue
():
id
=
334
def
save_queue
(
id
,
device_id
,
city_id
):
device_id
=
'00CA20EB-2719-4518-85CC-60E765AC526F'
city_id
=
'beijing'
queue_name_list
=
[
"native_queue"
,
"nearby_queue"
,
"nation_queue"
,
"megacity_queue"
]
queue_name_list
=
[
"native_queue"
,
"nearby_queue"
,
"nation_queue"
,
"megacity_queue"
]
for
i
in
queue_name_list
:
for
i
in
queue_name_list
:
sql
=
"select {} from device_diary_queue "
\
sql
=
"select {} from device_diary_queue "
\
...
@@ -59,6 +57,17 @@ def save_queue():
...
@@ -59,6 +57,17 @@ def save_queue():
df
.
to_csv
(
"/data/models/{}.csv"
.
format
(
i
),
index
=
None
)
df
.
to_csv
(
"/data/models/{}.csv"
.
format
(
i
),
index
=
None
)
print
(
"end"
)
print
(
"end"
)
def
delete
():
db
=
pymysql
.
connect
(
host
=
'rm-m5e842126ng59jrv6.mysql.rds.aliyuncs.com'
,
port
=
3306
,
user
=
'doris'
,
passwd
=
'o5gbA27hXHHm'
,
db
=
'doris_prod'
)
cursor
=
db
.
cursor
()
sql
=
"delete from device_diary_queue where device_id = '{}' and city_id = '{}';"
.
format
(
device_id
,
city_id
)
cursor
.
execute
(
sql
)
db
.
close
()
print
(
"shan"
)
def
insert
(
id
,
device_id
,
city_id
):
def
insert
(
id
,
device_id
,
city_id
):
queue_name_list
=
[
"native_queue"
,
"nearby_queue"
,
"nation_queue"
,
"megacity_queue"
]
queue_name_list
=
[
"native_queue"
,
"nearby_queue"
,
"nation_queue"
,
"megacity_queue"
]
a
=
{}
a
=
{}
...
@@ -78,7 +87,10 @@ def insert(id,device_id,city_id):
...
@@ -78,7 +87,10 @@ def insert(id,device_id,city_id):
print
(
"end"
)
print
(
"end"
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
# 先把数据保存下来,调用上面的save函数,
id
=
334
id
=
334
device_id
=
'00CA20EB-2719-4518-85CC-60E765AC526F'
device_id
=
'00CA20EB-2719-4518-85CC-60E765AC526F'
city_id
=
'beijing'
city_id
=
'beijing'
...
@@ -91,10 +103,3 @@ if __name__=="__main__":
...
@@ -91,10 +103,3 @@ if __name__=="__main__":
# 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