Przeglądaj źródła

delete code Goods Erro rows

huangyifan 11 miesięcy temu
rodzic
commit
8b4ab1f972
1 zmienionych plików z 3 dodań i 1 usunięć
  1. 3 1
      sync_amz_data/public/sp_api_client.py

+ 3 - 1
sync_amz_data/public/sp_api_client.py

@@ -1020,6 +1020,7 @@ class SpApiRequest:
                 conn.rollback()
                 print("错误过程2",e)
 
+
     @staticmethod
     def get_listing_info01(refresh_token, countryCode, asin, seller_id): # used in listing_infoTable
         # print(refresh_token)
@@ -1125,7 +1126,8 @@ class SpApiRequest:
         merge_df = df.merge(df_query,how='left',on=['asin', 'countryCode', 'marketplace_id', 'seller_id'],suffixes=['','_right'])
         merge_df['IsParent'] = merge_df.apply(lambda x:x['IsParent_right'] if x['IsParent']=='Erro' else x['IsParent'],axis=1)
         merge_df['parent_asin'] = merge_df.apply(lambda x: x['parent_asin_right'] if x['parent_asin'] == 'Erro' else x['parent_asin'], axis=1)
-
+        erro_df = merge_df.query("IsParent=='Erro' and parent_asin=='Erro'")
+        merge_df.drop(erro_df.index,inplace=True)
         detail_info_value = merge_df[['main_image', 'productTypes', 'BigCat_rank', 'BigCat_title', 'SmallCat_rank',
                                      'SmallCat_title', 'brandName', 'browseNode', 'itemName', 'IsParent', 'parent_asin',
                                      'asin', 'countryCode', 'marketplace_id', 'seller_id', 'update_time']].to_numpy().tolist()