From c360db45c917ba527b04d420f70da41403bb97e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E5=81=A5?= Date: Wed, 29 May 2024 17:58:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=8F=E8=94=BD=E8=BF=87=E9=AB=98=E7=89=A9?= =?UTF-8?q?=E4=B8=9A=E8=B4=B9=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dags/business/business/community/comm.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/dags/business/business/community/comm.py b/dags/business/business/community/comm.py index 09a1e5a..a008cf5 100644 --- a/dags/business/business/community/comm.py +++ b/dags/business/business/community/comm.py @@ -47,11 +47,13 @@ def build_doc(item): estate_charge = commutils.format_property_fee(item['estate_charge']) if pd.notna(estate_charge): - doc_dict['estate_charge'] = float(estate_charge) - # 表示该物业费已经从库中补充 - doc_dict['estate_charge_flag'] = 0 - # 先打10分,对于其他的流程在修改分数 - doc_dict['credit_detail'] = {'estate_charge_score': 10} + # 剔除过大物业费导致ES报错 + if float(estate_charge) <= 1000: + doc_dict['estate_charge'] = float(estate_charge) + # 表示该物业费已经从库中补充 + doc_dict['estate_charge_flag'] = 0 + # 先打10分,对于其他的流程在修改分数 + doc_dict['credit_detail'] = {'estate_charge_score': 10} finish_building_date = commutils.format_finish_building_date(item['finish_building_date']) if pd.notna(finish_building_date): @@ -155,7 +157,6 @@ def sync(city=None): # 写入csv文件,防止小区变动导致的后续过程更新报错, # seaweed_df.to_csv(path + '/seaweed.csv', sep='@', encoding='UTF-8', index=False) # 写入中间表clickhouse,解决多worker节点问题 - seaweed_df.loc[seaweed_df['estate_charge'] > 1000, 'estate_charge'] = None tmp_ck.to_sql_plus(seaweed_df[['_id', 'city', 'region', 'name', 'lng', 'lat', 'alias', 'estate_type2', 'build_type', 'household_count', 'block', 'estate_charge', 'finish_building_date']], 'community_summary')