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 "