From 98266e9c2bf5d476ccf490303117a888c1a16fdf Mon Sep 17 00:00:00 2001 From: "shenjian@fangjia.com" Date: Mon, 6 Mar 2023 15:49:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BA=BA=E5=9D=87=E6=B6=88?= =?UTF-8?q?=E8=B4=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dags/business/business/community/avg_cost.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dags/business/business/community/avg_cost.py b/dags/business/business/community/avg_cost.py index e8c4588..f4cd669 100644 --- a/dags/business/business/community/avg_cost.py +++ b/dags/business/business/community/avg_cost.py @@ -131,8 +131,10 @@ def sync(city=None): lng = commutils.format_lat_lng(item['lng']) lat = commutils.format_lat_lng(item['lat']) price = find_around_price(lng, lat) - seaweed_df.loc[index, 'avg_cost'] = price - + if price > 0: + seaweed_df.loc[index, 'avg_cost'] = price + else: + seaweed_df.loc[index, 'avg_cost'] = None with ThreadPoolExecutor(max_workers=30) as pool: for index, item in seaweed_df.iterrows(): pool.submit(find_around_price_item, index, item)