From 82119764c6c287058525a458885afc667c2640bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E5=81=A5?= Date: Sun, 27 Apr 2025 10:39:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dags/office/sell/fill_base_price.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dags/office/sell/fill_base_price.py b/dags/office/sell/fill_base_price.py index 71c759c..eeffce1 100644 --- a/dags/office/sell/fill_base_price.py +++ b/dags/office/sell/fill_base_price.py @@ -2,11 +2,14 @@ from goojia_utils import DIDATA_DEV_ELASTIC_CLIENT, dateutils, MAIN_MONGO_CLIENT import pandas as pd from datetime import datetime from pymongo import UpdateOne -import sys +import logging + +log = logging.getLogger(__name__) office_sell_stat_conn = MAIN_MONGO_CLIENT.get_collection('fangjia_stat', 'office_sell_stat') office_rent_stat_conn = MAIN_MONGO_CLIENT.get_collection('fangjia_stat', 'office_rent_stat') + def calc(city, year_month): query = {'date': year_month, 'cat': 'office'} if pd.notna(city): @@ -44,6 +47,9 @@ def calc(city, year_month): item['sell_price'] = round(city_radio[item['city']] * item['rent_price'] * 30 * 12, 0) return item + if len(merge2_df) == 0: + print(city + "无数据补充") + return merge2_df = threads.process_dataframe_multithread(merge2_df, deal, 10) merge2_df = merge2_df[merge2_df['sell_price'].notna()]