diff --git a/dags/business/business/community/avg_cost.py b/dags/business/business/community/avg_cost.py index 255f898..b52ffe3 100644 --- a/dags/business/business/community/avg_cost.py +++ b/dags/business/business/community/avg_cost.py @@ -109,17 +109,20 @@ def sync(city=None): print(lat) print(price) print(index) - seaweed_df.loc[index, 'avg_cost'] = price + if pd.notna(price): + seaweed_df.loc[index, 'avg_cost'] = int(price) + else: + seaweed_df.loc[index, 'avg_cost'] = None if item['_id'] == '50bd172ae4b0fbe60a6fe628': print(seaweed_df.loc[index]) - with ThreadPoolExecutor(max_workers=30) as pool: - for index, item in seaweed_df.iterrows(): - pool.submit(find_around_price_item, index, item) - # for index, item in seaweed_df.iterrows(): - # find_around_price_item(index, item) + # with ThreadPoolExecutor(max_workers=30) as pool: + # for index, item in seaweed_df.iterrows(): + # pool.submit(find_around_price_item, index, item) + for index, item in seaweed_df[seaweed_df['_id'] == '50bd172ae4b0fbe60a6fe628'].iterrows(): + find_around_price_item(index, item) actions = list() count = 0 - for index, item in seaweed_df.iterrows(): + for index, item in seaweed_df[seaweed_df['_id'] == '50bd172ae4b0fbe60a6fe628'].iterrows(): if item['_id'] == '50bd172ae4b0fbe60a6fe628': print(item) doc_info = build_doc(item)