From 2728bbbdad907130d44e7aa1f6cda04fbfbb0447 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E5=81=A5?= Date: Wed, 23 Apr 2025 17:54:22 +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/jh/price/pqsql_connect.py | 2 +- dags/jh/price/price_deviation.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dags/jh/price/pqsql_connect.py b/dags/jh/price/pqsql_connect.py index 2df749b..edde542 100644 --- a/dags/jh/price/pqsql_connect.py +++ b/dags/jh/price/pqsql_connect.py @@ -90,7 +90,7 @@ def get_evaluation_third_price(cityid,yearmonth,type='第三方'): return data_df def get_third_price(cityid,yearmonth): - sql = f"select urbn_id,gujia_bds_id,comm_nm,gujia_dtsr_dsc,gujia_bds_comm_avprc from base.bigdata_third_party_price_gj_h where urbn_id='{cityid}' and gujiabds_avprc_dt_val={yearmonth} and gujia_dtsr_dsc in ('链家','安居客') " + sql = f"select urbn_id,gujia_bds_id,comm_nm,gujia_dtsr_dsc,gujia_bds_comm_avprc from base.bigdata_third_party_price where urbn_id='{cityid}' and gujiabds_avprc_dt_val={yearmonth} and gujia_dtsr_dsc in ('链家','安居客') " data_df = pgdb.read(sql) data_df = data_df.rename(columns={'urbn_id': 'cityid','gujia_bds_id': '_id','gujia_dtsr_dsc': 'source','gujia_bds_comm_avprc': 'price'}) return data_df diff --git a/dags/jh/price/price_deviation.py b/dags/jh/price/price_deviation.py index c813aa6..bcf91bf 100644 --- a/dags/jh/price/price_deviation.py +++ b/dags/jh/price/price_deviation.py @@ -29,7 +29,7 @@ deal_price_df = deal_df.merge(price_df, on="gujia_comm_id", how="left") deal_price_df["ppe"] = round((deal_price_df["gujia_comm_basic_prc"] - deal_price_df['gujia_bds_trdtckt_prc']) / deal_price_df['gujia_bds_trdtckt_prc'], 4) #deal_price_df = deal_price_df[abs(deal_price_df['ppe']) > 0.15] -third_df = pgsql.scan_by_sql_to_data_frame(f"select gujia_bds_id as gujia_comm_id,gujia_dtsr_dsc,gujia_bds_comm_avprc from base.bigdata_third_party_price_gj_h where gujiabds_avprc_dt_val={month_last} ") +third_df = pgsql.scan_by_sql_to_data_frame(f"select gujia_bds_id as gujia_comm_id,gujia_dtsr_dsc,gujia_bds_comm_avprc from base.bigdata_third_party_price where gujiabds_avprc_dt_val={month_last} ") third_df = third_df[third_df.gujia_dtsr_dsc.isin(['贝壳','链家'])] # third_df = third_df[['gujia_comm_id','gujia_dtsr_dsc','gujia_bds_comm_avprc']] pivot_df = third_df.pivot(index='gujia_comm_id', columns='gujia_dtsr_dsc', values='gujia_bds_comm_avprc').reset_index()