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
46f936c1
Commit
46f936c1
authored
Aug 23, 2018
by
张彦钊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change sql for test
parent
1da4f2ad
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
7 deletions
+23
-7
diaryQueueUpdate.py
diaryQueueUpdate.py
+21
-5
testCases.py
local/testCases.py
+2
-2
No files found.
diaryQueueUpdate.py
View file @
46f936c1
...
...
@@ -14,6 +14,20 @@ import time
from
userProfile
import
get_active_users
import
os
def
get_video_id
():
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
test_con_sql
(
device_id
):
db
=
pymysql
.
connect
(
host
=
'rm-m5e842126ng59jrv6.mysql.rds.aliyuncs.com'
,
port
=
3306
,
user
=
'doris'
,
passwd
=
'o5gbA27hXHHm'
,
db
=
'doris_prod'
)
...
...
@@ -160,11 +174,13 @@ def merge_score(x_list, score_df):
def
update_dairy_queue
(
score_df
):
diary_id
=
score_df
[
"cid"
]
.
values
.
tolist
()
video_id
=
[]
x
=
1
while
x
<
len
(
diary_id
):
video_id
.
append
(
diary_id
[
x
])
x
+=
5
all_video_id
=
get_video_id
()
video_id
=
list
(
set
(
all_video_id
)
&
set
(
diary_id
))
# x = 1
# while x < len(diary_id):
# video_id.append(diary_id[x])
# x += 5
if
len
(
video_id
)
>
0
:
not_video_id
=
list
(
set
(
diary_id
)
-
set
(
video_id
))
not_video_id_df
=
score_df
.
loc
[
score_df
[
"cid"
]
.
isin
(
not_video_id
)]
...
...
local/testCases.py
View file @
46f936c1
...
...
@@ -3,7 +3,7 @@ import pymysql
import
pandas
as
pd
DIRECTORY_PATH
=
'/data2/models/'
def
con_sql
():
def
get_video_id
():
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;"
...
...
@@ -30,7 +30,7 @@ def queue():
if
__name__
==
"__main__"
:
all
=
queue
()
video
=
con_sql
()
video
=
get_video_id
()
video_id
=
[]
x
=
1
while
x
<
len
(
all
):
...
...
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