From c27e358f3ba33a0dd9bf2687f4b89e6e83d96fe1 Mon Sep 17 00:00:00 2001 From: "shenjian@fangjia.com" Date: Thu, 23 Feb 2023 17:43:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dags/business/business/community/trade.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dags/business/business/community/trade.py b/dags/business/business/community/trade.py index f0f9c39..d3a22d8 100644 --- a/dags/business/business/community/trade.py +++ b/dags/business/business/community/trade.py @@ -36,6 +36,9 @@ def sync(city=None): if len(deal_price_df) <= 0: log.info(f"无成交,无需同步") return + if 'match_city' not in deal_price_df.columns or 'match_region' not in deal_price_df.columns or 'match_name' not in deal_price_df.columns: + log.info(f"无成交,无需同步") + return deal_price_df = deal_price_df[['match_city', 'match_region', 'match_name', 'avg_price']] deal_price_df = deal_price_df.rename(columns={'match_city': 'city', 'match_region': 'region', 'match_name': 'name', 'avg_price': 'three_month_trade_avg_price'})