From e76d74300002d3410b4bbd7c8aab457ce3197eb3 Mon Sep 17 00:00:00 2001 From: "shenjian@fangjia.com" Date: Thu, 3 Nov 2022 15:54:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=87=8D=E7=82=B9=E5=B0=8F?= =?UTF-8?q?=E5=AD=A6=E3=80=81=E9=87=8D=E7=82=B9=E4=B8=AD=E5=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dags/business/business/community/education2.py | 7 ++++--- dags/business/business/community/relative_price_ranking.py | 1 + dags/business/business/community/total_price.py | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dags/business/business/community/education2.py b/dags/business/business/community/education2.py index 789a4ab..8287b1a 100644 --- a/dags/business/business/community/education2.py +++ b/dags/business/business/community/education2.py @@ -80,11 +80,12 @@ def deal(actions, item): def sync(city=None): log.info(f"开始同步教育资源【小学、中学】至206 {index_name}") - seaweed_query = {'status': 0, 'cat': 'district'} - if pd.notna(city): - seaweed_query['city'] = city seaweed_df = pd.read_csv(path + '/seaweed.csv', sep='@', encoding='UTF-8') + if pd.notna(city): + seaweed_df = seaweed_df[seaweed_df['city'] == city].copy() + seaweed_df = seaweed_df.reset_index() + seaweed_df = seaweed_df.drop(columns=['index']) actions = list() with ThreadPoolExecutor(max_workers=30) as pool: diff --git a/dags/business/business/community/relative_price_ranking.py b/dags/business/business/community/relative_price_ranking.py index edefae4..7914440 100644 --- a/dags/business/business/community/relative_price_ranking.py +++ b/dags/business/business/community/relative_price_ranking.py @@ -61,6 +61,7 @@ def sync(city=None): if pd.notna(city): seaweed_df = seaweed_df[seaweed_df['city'] == city].copy() seaweed_df = seaweed_df.reset_index() + seaweed_df = seaweed_df.drop(columns=['index']) def find_around_price_item(index, item): if index % 1000 == 0: diff --git a/dags/business/business/community/total_price.py b/dags/business/business/community/total_price.py index 66ca139..20d145c 100644 --- a/dags/business/business/community/total_price.py +++ b/dags/business/business/community/total_price.py @@ -62,6 +62,7 @@ def sync(city=None): if pd.notna(city): seaweed_df = seaweed_df[seaweed_df['city'] == city].copy() seaweed_df = seaweed_df.reset_index() + seaweed_df = seaweed_df.drop(columns=['index']) # 加载库中均价数据 query_sql = "SELECT city, region, name, avg_price FROM community_summary "