Browse Source

Update gh reply strategies: fix duplicate base

StrayWarrior 6 months ago
parent
commit
6fd0ebe793
2 changed files with 4 additions and 2 deletions
  1. 2 1
      alg_growth_3rd_gh_reply_video_v1.py
  2. 2 1
      alg_growth_gh_reply_video_v1.py

+ 2 - 1
alg_growth_3rd_gh_reply_video_v1.py

@@ -207,7 +207,8 @@ def rank_for_base(run_dt, run_hour, project, stats_table, rank_table, stg_key):
 
     # 在账号内排序,决定该账号(包括default)的base利用内容
     # 排序过程中,确保当前base策略参与排序,因此先关联再过滤
-    gh_ids_str = ','.join(f'"{x}"' for x in GH_IDS)
+    non_default_ids = list(filter(lambda x: x != 'default', GH_IDS))
+    gh_ids_str = ','.join(f'"{x}"' for x in non_default_ids)
     stats_df = stats_df.query(f'gh_id in ({gh_ids_str})')
 
     stats_with_strategy_df = stats_df \

+ 2 - 1
alg_growth_gh_reply_video_v1.py

@@ -193,7 +193,8 @@ def rank_for_base(run_dt, run_hour, rank_table):
 
     # 在账号内排序,决定该账号(包括default)的base利用内容
     # 排序过程中,确保当前base策略参与排序,因此先关联再过滤
-    gh_ids_str = ','.join(f'"{x}"' for x in GH_IDS)
+    non_default_ids = list(filter(lambda x: x != 'default', GH_IDS))
+    gh_ids_str = ','.join(f'"{x}"' for x in non_default_ids)
     stats_df = stats_df.query(f'gh_id in ({gh_ids_str})')
 
     stats_with_strategy_df = stats_df \