From 0792dccd927221a9e650ae3ae2f310e9e77d7796 Mon Sep 17 00:00:00 2001 From: Jian Shen Date: Tue, 25 Apr 2023 22:17:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dags/business/business/community/comm.py | 2 +- dags/business/business/community/price.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dags/business/business/community/comm.py b/dags/business/business/community/comm.py index 8ea484d..23ccb3a 100644 --- a/dags/business/business/community/comm.py +++ b/dags/business/business/community/comm.py @@ -155,7 +155,7 @@ def sync(city=None): # 写入csv文件,防止小区变动导致的后续过程更新报错, # seaweed_df.to_csv(path + '/seaweed.csv', sep='@', encoding='UTF-8', index=False) # 写入中间表clickhouse,解决多worker节点问题 - tmp_ck.to_sql_plus(seaweed_df[['city', 'region', 'name', 'lng', 'lat', 'alias', 'estate_type2', 'build_type', + 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') actions = list() diff --git a/dags/business/business/community/price.py b/dags/business/business/community/price.py index f819785..35d1238 100644 --- a/dags/business/business/community/price.py +++ b/dags/business/business/community/price.py @@ -40,7 +40,7 @@ def build_doc(item): def sync_by_city(city): - seaweed_df = tmp_ck.read_sql_query(f"select id, city, region, name from community_summary where city='{city}'") + seaweed_df = tmp_ck.read_sql_query(f"select _id, city, region, name from community_summary where city='{city}'") if len(seaweed_df) == 0: return @@ -116,7 +116,7 @@ def sync_by_city(city): action = { "_op_type": "update", "_index": index_name, - "_id": item['id'], + "_id": item['_id'], "doc": doc_info } actions.append(action)