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
66061209
Commit
66061209
authored
Aug 23, 2018
by
张彦钊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change sql for test
parent
4ddd65e7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
8 deletions
+40
-8
diaryQueueUpdate.py
diaryQueueUpdate.py
+1
-0
testCases.py
local/testCases.py
+39
-8
No files found.
diaryQueueUpdate.py
View file @
66061209
...
...
@@ -262,6 +262,7 @@ if __name__ == "__main__":
# # TODO 上线后把预测用户改成多进程预测
# data_set_cid = pd.read_csv(DIRECTORY_PATH + "data_set_cid.csv")["cid"].values.tolist()
#
...
...
local/testCases.py
View file @
66061209
import
utils
import
p
ickle
import
p
ymysql
import
pandas
as
pd
DIRECTORY_PATH
=
'/data2/models/'
with
open
(
DIRECTORY_PATH
+
"ffm.pkl"
,
"rb"
)
as
f
:
ffm_format_pandas
=
pickle
.
load
(
f
)
df
=
pd
.
read_csv
(
"/home/zhangyanzhao/data.csv"
)
data
=
ffm_format_pandas
.
transform
(
df
)
data
.
to_csv
(
"/home/zhangyanzhao/ffm.csv"
,
index
=
False
,
header
=
None
)
\ No newline at end of file
def
con_sql
():
db
=
pymysql
.
connect
(
host
=
'10.66.157.22'
,
port
=
4000
,
user
=
'root'
,
passwd
=
'3SYz54LS9#^9sBvC'
,
db
=
'eagle'
)
cursor
=
db
.
cursor
()
sql
=
"select diary_id from feed_diary_boost;"
cursor
.
execute
(
sql
)
result
=
cursor
.
fetchall
()
df
=
pd
.
DataFrame
(
list
(
result
))
video_id
=
df
[
0
]
.
values
.
tolist
()
print
(
video_id
[:
10
])
db
.
close
()
return
video_id
def
queue
():
db
=
pymysql
.
connect
(
host
=
'rm-m5e842126ng59jrv6.mysql.rds.aliyuncs.com'
,
port
=
3306
,
user
=
'doris'
,
passwd
=
'o5gbA27hXHHm'
,
db
=
'doris_prod'
)
cursor
=
db
.
cursor
()
sql
=
"select native_queue from device_diary_queue where device_id = 358035085192742;"
cursor
.
execute
(
sql
)
result
=
cursor
.
fetchall
()
df
=
pd
.
DataFrame
(
list
(
result
))
all
=
df
.
loc
[
0
,
0
]
.
split
(
","
)
print
(
all
[:
10
])
db
.
close
()
return
all
if
__name__
==
"__main__"
:
all
=
queue
()
video
=
con_sql
()
video_id
=
[]
x
=
1
while
x
<
len
(
all
):
video_id
.
append
(
all
[
x
])
x
+=
3
print
(
video_id
)
print
(
video_id
in
video
)
\ No newline at end of file
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