From 2fa43377fedd28369f5c3a270233666e01cb0306 Mon Sep 17 00:00:00 2001 From: "shenjian@fangjia.com" Date: Thu, 9 Mar 2023 16:51:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=9A=E7=BA=BF=E7=A8=8B=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E6=8E=92=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dags/business/business/community/avg_cost.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dags/business/business/community/avg_cost.py b/dags/business/business/community/avg_cost.py index 607d176..74d210b 100644 --- a/dags/business/business/community/avg_cost.py +++ b/dags/business/business/community/avg_cost.py @@ -85,6 +85,7 @@ def find_around_price_item(seaweed_df, index, item): print(index) if pd.notna(price): seaweed_df.loc[index, 'avg_cost'] = int(price) + print("success") else: seaweed_df.loc[index, 'avg_cost'] = None if item['_id'] == '50bd172ae4b0fbe60a6fe628': @@ -117,6 +118,7 @@ def sync(city=None): seaweed_df = seaweed_df[seaweed_df['city'] == city].copy() seaweed_df = seaweed_df.reset_index(drop=True) + i with ThreadPoolExecutor(max_workers=30) as pool: for index, item in seaweed_df.iterrows(): pool.submit(find_around_price_item, seaweed_df, index, item)