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
4d953aca
Commit
4d953aca
authored
Dec 24, 2019
by
高雅喆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
画像增量存储
parent
10f3a656
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
dist_update_user_portrait_service.py
eda/smart_rank/dist_update_user_portrait_service.py
+3
-2
No files found.
eda/smart_rank/dist_update_user_portrait_service.py
View file @
4d953aca
...
...
@@ -104,8 +104,9 @@ def get_user_service_portrait(cl_id, all_word_tags, all_tag_tag_type, all_3tag_2
# 写tidb,redis同步
stat_date
=
datetime
.
datetime
.
today
()
.
strftime
(
'
%
Y-
%
m-
%
d'
)
replace_sql
=
"""replace into user_service_portrait_tags (stat_date, cl_id, tag_list) values("{stat_date}","{cl_id}","{tag_list}")"""
\
.
format
(
stat_date
=
stat_date
,
cl_id
=
cl_id
,
tag_list
=
gmkv_tag_score_sum
)
gmkv_tag_score3_sum_dict
=
sorted
(
gmkv_tag_score3_sum_dict
.
items
(),
key
=
lambda
i
:
i
[
1
],
reverse
=
True
)[:
5
]
replace_sql
=
"""insert into user_service_portrait_tags (stat_date, cl_id, portrait_tag_list) values("{stat_date}","{cl_id}","{portrait_tag_list}")"""
\
.
format
(
stat_date
=
stat_date
,
cl_id
=
cl_id
,
portrait_tag_list
=
gmkv_tag_score3_sum_dict
)
cur_jerry_test
.
execute
(
replace_sql
)
db_jerry_test
.
commit
()
cur_jerry_test
.
close
()
...
...
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