|
@@ -18,7 +18,7 @@ from log import Log
|
|
|
import os
|
|
import os
|
|
|
from argparse import ArgumentParser
|
|
from argparse import ArgumentParser
|
|
|
from constants import AutoReplyAccountType
|
|
from constants import AutoReplyAccountType
|
|
|
-from alg_growth_common import check_unsafe_video, filter_unsafe_video
|
|
|
|
|
|
|
+from alg_growth_common import check_unsafe_video, filter_unsafe_video, filter_audit_failed_video
|
|
|
|
|
|
|
|
CONFIG, _ = set_config()
|
|
CONFIG, _ = set_config()
|
|
|
LOGGER = Log()
|
|
LOGGER = Log()
|
|
@@ -191,10 +191,11 @@ def rank_for_layer2(run_dt, run_hour, project, stats_table, rank_table):
|
|
|
|
|
|
|
|
# 基础过滤for账号
|
|
# 基础过滤for账号
|
|
|
df = stats_df.query('send_count > 200 and score > 0')
|
|
df = stats_df.query('send_count > 200 and score > 0')
|
|
|
-
|
|
|
|
|
|
|
+ df = filter_audit_failed_video(df)
|
|
|
# fallback to base if necessary
|
|
# fallback to base if necessary
|
|
|
base_strategy_df, _ = get_last_strategy_result(
|
|
base_strategy_df, _ = get_last_strategy_result(
|
|
|
project, rank_table, dt_version, BASE_GROUP_NAME)
|
|
project, rank_table, dt_version, BASE_GROUP_NAME)
|
|
|
|
|
+ base_strategy_df = filter_audit_failed_video(base_strategy_df)
|
|
|
|
|
|
|
|
for gh_id in GH_IDS:
|
|
for gh_id in GH_IDS:
|
|
|
if gh_id == 'default':
|
|
if gh_id == 'default':
|
|
@@ -267,7 +268,7 @@ def rank_for_base(run_dt, run_hour, project, stats_table, rank_table, stg_key):
|
|
|
|
|
|
|
|
# 合并default和分账号数据
|
|
# 合并default和分账号数据
|
|
|
grouped_stats_df = pd.concat([default_stats_df, stats_with_strategy_df]).reset_index()
|
|
grouped_stats_df = pd.concat([default_stats_df, stats_with_strategy_df]).reset_index()
|
|
|
-
|
|
|
|
|
|
|
+ grouped_stats_df = filter_audit_failed_video(grouped_stats_df)
|
|
|
def set_top_n(group, n=2):
|
|
def set_top_n(group, n=2):
|
|
|
group_sorted = group.sort_values(by='score', ascending=False)
|
|
group_sorted = group.sort_values(by='score', ascending=False)
|
|
|
top_n = group_sorted.head(n)
|
|
top_n = group_sorted.head(n)
|