Browse Source

Fix gh reply: only get valid accounts

StrayWarrior 5 months ago
parent
commit
2d07fd533d
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

@@ -43,7 +43,8 @@ SEND_N = 1
 def get_and_update_gh_ids(run_dt):
 def get_and_update_gh_ids(run_dt):
     gh = get_odps_df_of_max_partition(ODS_PROJECT, GH_DETAIL, {'dt': run_dt})
     gh = get_odps_df_of_max_partition(ODS_PROJECT, GH_DETAIL, {'dt': run_dt})
     gh = gh.to_pandas()
     gh = gh.to_pandas()
-    gh = gh[gh['type'] == AutoReplyAccountType.EXTERNAL_GZH.value]
+    gh_type = AutoReplyAccountType.EXTERNAL_GZH.value
+    gh = gh.query(f'type == {gh_type} and is_delete == 0')
     # default单独处理
     # default单独处理
     if 'default' not in gh['gh_id'].values:
     if 'default' not in gh['gh_id'].values:
         new_row = pd.DataFrame({'gh_id': ['default'], 'gh_name': ['默认'], 'type': [2], 'category1': ['泛生活']},
         new_row = pd.DataFrame({'gh_id': ['default'], 'gh_name': ['默认'], 'type': [2], 'category1': ['泛生活']},

+ 2 - 1
alg_growth_gh_reply_video_v1.py

@@ -43,7 +43,8 @@ pd.set_option('display.max_rows', None)
 def get_and_update_gh_ids(run_dt):
 def get_and_update_gh_ids(run_dt):
     gh = get_odps_df_of_max_partition(ODS_PROJECT, GH_DETAIL, {'dt': run_dt})
     gh = get_odps_df_of_max_partition(ODS_PROJECT, GH_DETAIL, {'dt': run_dt})
     gh = gh.to_pandas()
     gh = gh.to_pandas()
-    gh = gh[gh['type'] == AutoReplyAccountType.SELF_OWNED_GZH.value]
+    gh_type = AutoReplyAccountType.SELF_OWNED_GZH.value
+    gh = gh.query(f'type == {gh_type} and is_delete == 0')
     # default单独处理
     # default单独处理
     if 'default' not in gh['gh_id'].values:
     if 'default' not in gh['gh_id'].values:
         new_row = pd.DataFrame({'gh_id': ['default'], 'gh_name': ['默认'], 'type': [2], 'category1': ['泛生活']},
         new_row = pd.DataFrame({'gh_id': ['default'], 'gh_name': ['默认'], 'type': [2], 'category1': ['泛生活']},