From e079380c500578b876caa35fb37b3dc5226743b4 Mon Sep 17 00:00:00 2001 From: "shenjian@fangjia.com" Date: Mon, 20 Feb 2023 18:29:04 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E6=96=B0=E5=A2=9Ecommunity=5Fsummary?= =?UTF-8?q?=E5=9F=8E=E5=B8=82=E4=BC=A0=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dags/business/business/community/avg_cost.py | 4 +++- .../business/community/business_district.py | 6 ++++-- dags/business/business/community/comm.py | 9 +++++++-- dags/business/business/community/consumption.py | 5 ++++- dags/business/business/community/education.py | 13 +++++++------ dags/business/business/community/education2.py | 6 ++++-- .../business/community/estate_charge_complete.py | 4 +++- .../business/community/estate_charge_ranking.py | 5 +++-- dags/business/business/community/extra.py | 4 +++- dags/business/business/community/life.py | 6 ++++-- dags/business/business/community/medical.py | 4 +++- dags/business/business/community/other.py | 5 +++-- dags/business/business/community/price.py | 4 +++- dags/business/business/community/price_rating.py | 4 +++- .../business/community/relative_price_ranking.py | 4 +++- dags/business/business/community/sell.py | 4 +++- dags/business/business/community/total_price.py | 4 +++- .../business/community/total_price_complete.py | 11 ++++++++--- dags/business/business/community/trade.py | 12 +++++++----- dags/business/business/community/traffic.py | 4 +++- 20 files changed, 81 insertions(+), 37 deletions(-) diff --git a/dags/business/business/community/avg_cost.py b/dags/business/business/community/avg_cost.py index 0b705c9..316d15f 100644 --- a/dags/business/business/community/avg_cost.py +++ b/dags/business/business/community/avg_cost.py @@ -7,6 +7,7 @@ from goojia_utils import ElasticSearchClient, commutils, dateutils, areautils from elasticsearch import helpers import numpy as np from concurrent.futures import ThreadPoolExecutor +import sys log = logging.getLogger(__name__) es206_client = ElasticSearchClient(host='192.168.0.206') @@ -150,4 +151,5 @@ def sync(city=None): log.info("完成同步消费数据...") -sync() \ No newline at end of file +city = sys.argv[1] if len(sys.argv) > 1 else None +sync(city) \ No newline at end of file diff --git a/dags/business/business/community/business_district.py b/dags/business/business/community/business_district.py index 0a21ad1..ccece89 100644 --- a/dags/business/business/community/business_district.py +++ b/dags/business/business/community/business_district.py @@ -3,10 +3,11 @@ """ import logging import pandas as pd -from goojia_utils import ElasticSearchClient, commutils, dateutils, poiutils +from goojia_utils import ElasticSearchClient, commutils, dateutils from elasticsearch import helpers from concurrent.futures import ThreadPoolExecutor from threading import Lock +import sys log = logging.getLogger(__name__) es206_client = ElasticSearchClient(host='192.168.0.206') @@ -104,4 +105,5 @@ def sync(city=None): log.info(f"完成同步商圈至206 {index_name}") -sync() \ No newline at end of file +city = sys.argv[1] if len(sys.argv) > 1 else None +sync(city) \ No newline at end of file diff --git a/dags/business/business/community/comm.py b/dags/business/business/community/comm.py index f08d67f..7134e3d 100644 --- a/dags/business/business/community/comm.py +++ b/dags/business/business/community/comm.py @@ -7,6 +7,7 @@ import pandas as pd from goojia_utils import MAIN_MONGO_CLIENT, ElasticSearchClient, commutils, dateutils from elasticsearch import helpers import os +import sys log = logging.getLogger(__name__) seaweed_conn = MAIN_MONGO_CLIENT.get_collection('fangjia', 'seaweed') @@ -93,7 +94,10 @@ def sync(city=None): 'estate_charge': 1, 'finish_building_date': 1}) .batch_size(100000))) - community_summary_df = es206_client.scan_by_sql_to_data_frame(f"select id from {index_name}") + sql = f"select id from {index_name} " + if pd.notna(city): + sql += f" from city={city}" + community_summary_df = es206_client.scan_by_sql_to_data_frame(sql) seaweed_df['_id'] = seaweed_df['_id'].astype(str) if len(community_summary_df) > 0: @@ -154,4 +158,5 @@ def sync(city=None): log.info(f"完成同步小区基本属性至206 {index_name}") -sync() +city = sys.argv[1] if len(sys.argv) > 1 else None +sync(city) diff --git a/dags/business/business/community/consumption.py b/dags/business/business/community/consumption.py index 11af5a5..f40b273 100644 --- a/dags/business/business/community/consumption.py +++ b/dags/business/business/community/consumption.py @@ -8,6 +8,7 @@ import logging import os from elasticsearch import helpers import matplotlib.pyplot as plt +import sys from sklearn.mixture import GaussianMixture from sklearn.preprocessing import QuantileTransformer @@ -249,5 +250,7 @@ def save_png(community_city): # 关窗口 plt.close() -sync() + +city = sys.argv[1] if len(sys.argv) > 1 else None +sync(city) #dingutils.send_text("【分布图生成完毕】财力评级已完成, 请点击 https://nextcloud.fangjia.com/s/Jqs5BzXi8xLYeH9 查看分布图", "c7ac6c86bfbe49a95e30a68616c4d784ae7781c715430dc9c5f6b46d3e6ebd78") diff --git a/dags/business/business/community/education.py b/dags/business/business/community/education.py index 4af97d0..f00e718 100644 --- a/dags/business/business/community/education.py +++ b/dags/business/business/community/education.py @@ -3,10 +3,11 @@ """ import logging import pandas as pd -from goojia_utils import MAIN_MONGO_CLIENT, ElasticSearchClient, commutils, dateutils, areautils, poiutils +from goojia_utils import ElasticSearchClient, commutils, dateutils, poiutils from elasticsearch import helpers from concurrent.futures import ThreadPoolExecutor from threading import Lock +import sys log = logging.getLogger(__name__) es206_client = ElasticSearchClient(host='192.168.0.206') @@ -62,11 +63,10 @@ def deal(actions, item): def sync(city=None): log.info(f"开始同步教育资源【幼儿园、大学】至206 {index_name}") - seaweed_query = {'status': 0, 'cat': 'district'} - if pd.notna(city): - seaweed_query['city'] = city - seaweed_df = pd.read_csv(path + '/seaweed.csv', sep='@', encoding='UTF-8') + if pd.notna(city): + seaweed_df = seaweed_df[seaweed_df['city'] == city].copy() + seaweed_df = seaweed_df.reset_index(drop=True) actions = list() with ThreadPoolExecutor(max_workers=30) as pool: @@ -83,4 +83,5 @@ def sync(city=None): log.info(f"完成同步教育资源至206 {index_name}") -sync() \ No newline at end of file +city = sys.argv[1] if len(sys.argv) > 1 else None +sync(city) \ No newline at end of file diff --git a/dags/business/business/community/education2.py b/dags/business/business/community/education2.py index 3fd27ba..ec37083 100644 --- a/dags/business/business/community/education2.py +++ b/dags/business/business/community/education2.py @@ -3,10 +3,11 @@ """ import logging import pandas as pd -from goojia_utils import MAIN_MONGO_CLIENT, ElasticSearchClient, commutils, dateutils, areautils, poiutils +from goojia_utils import ElasticSearchClient, commutils, dateutils, poiutils from elasticsearch import helpers from concurrent.futures import ThreadPoolExecutor from threading import Lock +import sys log = logging.getLogger(__name__) es206_client = ElasticSearchClient(host='192.168.0.206') @@ -95,4 +96,5 @@ def sync(city=None): log.info(f"完成同步教育资源至206 {index_name}") -sync() \ No newline at end of file +city = sys.argv[1] if len(sys.argv) > 1 else None +sync(city) \ No newline at end of file diff --git a/dags/business/business/community/estate_charge_complete.py b/dags/business/business/community/estate_charge_complete.py index 23c2460..becd95e 100644 --- a/dags/business/business/community/estate_charge_complete.py +++ b/dags/business/business/community/estate_charge_complete.py @@ -4,6 +4,7 @@ from goojia_utils import ElasticSearchClient, areautils, dateutils import pandas as pd import logging +import sys from elasticsearch import helpers from concurrent.futures import ThreadPoolExecutor @@ -140,4 +141,5 @@ def sync(city=None): sync_by_city(city) -sync() \ No newline at end of file +city = sys.argv[1] if len(sys.argv) > 1 else None +sync(city) \ No newline at end of file diff --git a/dags/business/business/community/estate_charge_ranking.py b/dags/business/business/community/estate_charge_ranking.py index db6489a..a5319af 100644 --- a/dags/business/business/community/estate_charge_ranking.py +++ b/dags/business/business/community/estate_charge_ranking.py @@ -5,6 +5,7 @@ from goojia_utils import ElasticSearchClient, nextcloudutils import pandas as pd import logging import os +import sys from elasticsearch import helpers import matplotlib.pyplot as plt @@ -163,6 +164,6 @@ def save_png(community_city): plt.close() - -sync() +city = sys.argv[1] if len(sys.argv) > 1 else None +sync(city) #dingutils.send_text("【分布图生成完毕】物业费评级已完成, 请点击 https://nextcloud.fangjia.com/s/HbifLoEDc5wi8HR 查看分布图", "c7ac6c86bfbe49a95e30a68616c4d784ae7781c715430dc9c5f6b46d3e6ebd78") \ No newline at end of file diff --git a/dags/business/business/community/extra.py b/dags/business/business/community/extra.py index 4ddad24..7561eac 100644 --- a/dags/business/business/community/extra.py +++ b/dags/business/business/community/extra.py @@ -14,6 +14,7 @@ import pandas as pd from elasticsearch import helpers from concurrent.futures import ThreadPoolExecutor from threading import Lock +import sys log = logging.getLogger(__name__) es206_client = ElasticSearchClient(host='192.168.0.206') @@ -140,4 +141,5 @@ def sync(city=None): log.info(f"完成同步附加标签至206 {index_name}") -sync() \ No newline at end of file +city = sys.argv[1] if len(sys.argv) > 1 else None +sync(city) \ No newline at end of file diff --git a/dags/business/business/community/life.py b/dags/business/business/community/life.py index 3c62f6f..0e62d00 100644 --- a/dags/business/business/community/life.py +++ b/dags/business/business/community/life.py @@ -3,10 +3,11 @@ """ import logging import pandas as pd -from goojia_utils import MAIN_MONGO_CLIENT, ElasticSearchClient, commutils, dateutils, areautils, poiutils +from goojia_utils import ElasticSearchClient, commutils, dateutils, poiutils from elasticsearch import helpers from concurrent.futures import ThreadPoolExecutor from threading import Lock +import sys log = logging.getLogger(__name__) es206_client = ElasticSearchClient(host='192.168.0.206') @@ -96,4 +97,5 @@ def sync(city=None): log.info(f"完成同步生活配套至206 {index_name}") -sync() \ No newline at end of file +city = sys.argv[1] if len(sys.argv) > 1 else None +sync(city) \ No newline at end of file diff --git a/dags/business/business/community/medical.py b/dags/business/business/community/medical.py index 832a4bf..536b871 100644 --- a/dags/business/business/community/medical.py +++ b/dags/business/business/community/medical.py @@ -7,6 +7,7 @@ from goojia_utils import MAIN_MONGO_CLIENT, ElasticSearchClient, commutils, date from elasticsearch import helpers from concurrent.futures import ThreadPoolExecutor from threading import Lock +import sys log = logging.getLogger(__name__) seaweed_conn = MAIN_MONGO_CLIENT.get_collection('fangjia', 'seaweed') @@ -83,4 +84,5 @@ def sync(city=None): log.info(f"完成同步医院至206 {index_name}") -sync() \ No newline at end of file +city = sys.argv[1] if len(sys.argv) > 1 else None +sync(city) \ No newline at end of file diff --git a/dags/business/business/community/other.py b/dags/business/business/community/other.py index 0f02d66..6a67cff 100644 --- a/dags/business/business/community/other.py +++ b/dags/business/business/community/other.py @@ -5,7 +5,7 @@ from goojia_utils import ElasticSearchClient, dateutils import logging import pandas as pd from elasticsearch import helpers -import datetime +import sys log = logging.getLogger(__name__) es206_client = ElasticSearchClient(host='192.168.0.206') @@ -57,4 +57,5 @@ def sync(city=None): log.info(f"完成同步售租比、人口数至206 {index_name}") -sync() \ No newline at end of file +city = sys.argv[1] if len(sys.argv) > 1 else None +sync(city) \ No newline at end of file diff --git a/dags/business/business/community/price.py b/dags/business/business/community/price.py index e148e92..7d967ad 100644 --- a/dags/business/business/community/price.py +++ b/dags/business/business/community/price.py @@ -5,6 +5,7 @@ import logging import pandas as pd from goojia_utils import ElasticSearchClient, commutils, dateutils, areautils from elasticsearch import helpers +import sys log = logging.getLogger(__name__) es206_client = ElasticSearchClient(host='192.168.0.206') @@ -139,4 +140,5 @@ def sync(city=None): log.info(f"完成同步价格信息至206 {index_name}") -sync() \ No newline at end of file +city = sys.argv[1] if len(sys.argv) > 1 else None +sync(city) \ No newline at end of file diff --git a/dags/business/business/community/price_rating.py b/dags/business/business/community/price_rating.py index 2860934..3020b87 100644 --- a/dags/business/business/community/price_rating.py +++ b/dags/business/business/community/price_rating.py @@ -8,6 +8,7 @@ from goojia_utils import ElasticSearchClient import pandas as pd import logging from elasticsearch import helpers +import sys from sklearn.mixture import GaussianMixture @@ -83,4 +84,5 @@ def sync(city=None): calc_price_rating(city) -sync() +city = sys.argv[1] if len(sys.argv) > 1 else None +sync(city) diff --git a/dags/business/business/community/relative_price_ranking.py b/dags/business/business/community/relative_price_ranking.py index dd408df..2bc9117 100644 --- a/dags/business/business/community/relative_price_ranking.py +++ b/dags/business/business/community/relative_price_ranking.py @@ -7,6 +7,7 @@ import pandas as pd from goojia_utils import ElasticSearchClient, commutils, dateutils from elasticsearch import helpers from concurrent.futures import ThreadPoolExecutor +import sys log = logging.getLogger(__name__) es206_client = ElasticSearchClient(host='192.168.0.206') @@ -112,4 +113,5 @@ def sync(city=None): log.info("完成同步相对价格排名数据...") -sync() \ No newline at end of file +city = sys.argv[1] if len(sys.argv) > 1 else None +sync(city) \ No newline at end of file diff --git a/dags/business/business/community/sell.py b/dags/business/business/community/sell.py index 408cf31..79ca482 100644 --- a/dags/business/business/community/sell.py +++ b/dags/business/business/community/sell.py @@ -6,6 +6,7 @@ import pandas as pd from goojia_utils import MAIN_MONGO_CLIENT, ElasticSearchClient, commutils, dateutils from elasticsearch import helpers from concurrent.futures import ThreadPoolExecutor +import sys log = logging.getLogger(__name__) seaweed_conn = MAIN_MONGO_CLIENT.get_collection('fangjia', 'seaweed') @@ -84,4 +85,5 @@ def sync(city=None): log.info(f"完成同步出售信息至206 {index_name}") -sync() \ No newline at end of file +city = sys.argv[1] if len(sys.argv) > 1 else None +sync(city) \ No newline at end of file diff --git a/dags/business/business/community/total_price.py b/dags/business/business/community/total_price.py index 3b6f867..91082fb 100644 --- a/dags/business/business/community/total_price.py +++ b/dags/business/business/community/total_price.py @@ -7,6 +7,7 @@ from goojia_utils import MAIN_MONGO_CLIENT, ElasticSearchClient, commutils, date from elasticsearch import helpers from concurrent.futures import ThreadPoolExecutor import re +import sys log = logging.getLogger(__name__) seaweed_conn = MAIN_MONGO_CLIENT.get_collection('fangjia', 'seaweed') @@ -106,4 +107,5 @@ def sync(city=None): log.info(f"完成同步户均总价信息至206 {index_name}") -sync() +city = sys.argv[1] if len(sys.argv) > 1 else None +sync(city) diff --git a/dags/business/business/community/total_price_complete.py b/dags/business/business/community/total_price_complete.py index 3a94f63..a2f07a6 100644 --- a/dags/business/business/community/total_price_complete.py +++ b/dags/business/business/community/total_price_complete.py @@ -5,6 +5,7 @@ import logging import pandas as pd from goojia_utils import ElasticSearchClient, dateutils from elasticsearch import helpers +import sys log = logging.getLogger(__name__) es206_client = ElasticSearchClient(host='192.168.0.206') @@ -101,10 +102,13 @@ def complete_by_region_area(community_factor_df): community_factor_df['total_price'] = community_factor_df['avg_price'] * community_factor_df['factor'] -def sync(): +def sync(city=None): log.info(f"开始补全户均总价信息至206 {index_name}") - community_df = es206_client.scan_by_sql_to_data_frame("select city, region, name, avg_price, finish_building_date from community_summary where avg_price is not null and total_price is null") + sql = "select city, region, name, avg_price, finish_building_date from community_summary where avg_price is not null and total_price is null " + if pd.notna(city): + sql += " and city='" + city + "'" + community_df = es206_client.scan_by_sql_to_data_frame(sql) community_factor_df = complete_by_area(community_df) complete_by_build_year_area(community_factor_df) @@ -115,4 +119,5 @@ def sync(): log.info(f"完成补全户均总价信息至206 {index_name}") -sync() +city = sys.argv[1] if len(sys.argv) > 1 else None +sync(city) diff --git a/dags/business/business/community/trade.py b/dags/business/business/community/trade.py index ad2aa5d..0694d6c 100644 --- a/dags/business/business/community/trade.py +++ b/dags/business/business/community/trade.py @@ -3,6 +3,7 @@ """ import logging import pandas as pd +import sys from goojia_utils import ElasticSearchClient, commutils, dateutils from elasticsearch import helpers @@ -24,12 +25,12 @@ def build_doc(item): def sync(city=None): log.info(f"开始同步成交信息至206 {index_name}") - seaweed_query = {'cat': 'district', 'status': 0} cities = None - if pd.notna(city): - seaweed_query['city'] = city - cities = [city] seaweed_df = pd.read_csv(path + '/seaweed.csv', sep='@', encoding='UTF-8') + if pd.notna(city): + cities = [city] + seaweed_df = seaweed_df[seaweed_df['city'] == city].copy() + seaweed_df = seaweed_df.reset_index(drop=True) deal_price_df = commutils.get_deal_avg_price(cities, 3) deal_price_df = deal_price_df[['match_city', 'match_region', 'match_name', 'avg_price']] @@ -68,4 +69,5 @@ def sync(city=None): log.info(f"完成同步成交信息至206 {index_name}") -sync() +city = sys.argv[1] if len(sys.argv) > 1 else None +sync(city) diff --git a/dags/business/business/community/traffic.py b/dags/business/business/community/traffic.py index dade577..34e90ad 100644 --- a/dags/business/business/community/traffic.py +++ b/dags/business/business/community/traffic.py @@ -7,6 +7,7 @@ from goojia_utils import ElasticSearchClient, commutils, dateutils, poiutils from elasticsearch import helpers from concurrent.futures import ThreadPoolExecutor from threading import Lock +import sys log = logging.getLogger(__name__) es206_client = ElasticSearchClient(host='192.168.0.206') @@ -86,4 +87,5 @@ def sync(city=None): log.info(f"完成同步交通至206 {index_name}") -sync() \ No newline at end of file +city = sys.argv[1] if len(sys.argv) > 1 else None +sync(city) \ No newline at end of file From f363f72a41349b7b40e8d6b551f932aec772df79 Mon Sep 17 00:00:00 2001 From: "shenjian@fangjia.com" Date: Tue, 21 Feb 2023 09:32:19 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E7=BC=96=E6=8E=92=EF=BC=8C=E4=BC=98=E5=8C=96=E8=B4=A2=E5=8A=9B?= =?UTF-8?q?=E8=AF=84=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dags/business/community_summary_dag.py | 43 +++++++++++++------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/dags/business/community_summary_dag.py b/dags/business/community_summary_dag.py index 0e204ad..6cb1392 100644 --- a/dags/business/community_summary_dag.py +++ b/dags/business/community_summary_dag.py @@ -10,84 +10,85 @@ with DAG( catchup=True, description="地址输出信息分类数据定时更新" ) as dag: - t1 = BashOperator( + comm = BashOperator( task_id='comm', bash_command='python /opt/airflow/dags/repo/dags/business/business/community/comm.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', ) - t2 = BashOperator( + price = BashOperator( task_id='price', bash_command='python /opt/airflow/dags/repo/dags/business/business/community/price.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', ) - t3 = BashOperator( + sell = BashOperator( task_id='sell', bash_command='python /opt/airflow/dags/repo/dags/business/business/community/sell.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', ) - t4 = BashOperator( + avg_cost = BashOperator( task_id='avg_cost', bash_command='python /opt/airflow/dags/repo/dags/business/business/community/avg_cost.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', ) - t5 = BashOperator( + trade = BashOperator( task_id='trade', bash_command='python /opt/airflow/dags/repo/dags/business/business/community/trade.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', ) - t6 = BashOperator( + total_price = BashOperator( task_id='total_price', bash_command='python /opt/airflow/dags/repo/dags/business/business/community/total_price.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', ) - t6_1 = BashOperator( + total_price_complete = BashOperator( task_id='total_price_complete', bash_command='python /opt/airflow/dags/repo/dags/business/business/community/total_price_complete.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', ) - t7 = BashOperator( + traffic = BashOperator( task_id='traffic', bash_command='python /opt/airflow/dags/repo/dags/business/business/community/traffic.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', ) - t7_1 = BashOperator( + business_district = BashOperator( task_id='business_district', bash_command='python /opt/airflow/dags/repo/dags/business/business/community/business_district.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', ) - t8 = BashOperator( + medical = BashOperator( task_id='medical', bash_command='python /opt/airflow/dags/repo/dags/business/business/community/medical.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', ) - t9 = BashOperator( + life = BashOperator( task_id='life', bash_command='python /opt/airflow/dags/repo/dags/business/business/community/life.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', ) - t10 = BashOperator( + relative_price_ranking = BashOperator( task_id='relative_price_ranking', bash_command='python /opt/airflow/dags/repo/dags/business/business/community/relative_price_ranking.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', ) - t10_1 = BashOperator( + estate_charge_complete = BashOperator( task_id='estate_charge_complete', bash_command='python /opt/airflow/dags/repo/dags/business/business/community/estate_charge_complete.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', ) - t10_2 = BashOperator( + estate_charge_ranking = BashOperator( task_id='estate_charge_ranking', bash_command='python /opt/airflow/dags/repo/dags/business/business/community/estate_charge_ranking.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', ) - t11 = BashOperator( + consumption = BashOperator( task_id='consumption', bash_command='python /opt/airflow/dags/repo/dags/business/business/community/consumption.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', ) - t12 = BashOperator( + price_rating = BashOperator( task_id='price_rating', bash_command='python /opt/airflow/dags/repo/dags/business/business/community/price_rating.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', ) - t13 = BashOperator( + education = BashOperator( task_id='education', bash_command='python /opt/airflow/dags/repo/dags/business/business/community/education.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', ) - t14 = BashOperator( + education2 = BashOperator( task_id='education2', bash_command='python /opt/airflow/dags/repo/dags/business/business/community/education2.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', ) - t15 = BashOperator( + extra = BashOperator( task_id='extra', bash_command='python /opt/airflow/dags/repo/dags/business/business/community/extra.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', ) - t16 = BashOperator( + other = BashOperator( task_id='other', bash_command='python /opt/airflow/dags/repo/dags/business/business/community/other.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', ) - t1 >> t2 >> t3 >> t4 >> t5 >> t6 >> t6_1 >> t7 >> t7_1 >> t8 >> t9 >> t10 >> t10_1 >> t10_2 >> t11 >> t12 >> t13 >> t14 >> t15 >> t16 + comm >> price >> avg_cost >> total_price >> total_price_complete >> relative_price_ranking >> estate_charge_complete >> estate_charge_ranking \ + >> consumption >> price_rating >> sell >> trade >> traffic >> business_district >> medical >> life >> education >> education2 >> extra >> other From de0e9924b13275e1921183ba31426eca325b43e8 Mon Sep 17 00:00:00 2001 From: "shenjian@fangjia.com" Date: Tue, 21 Feb 2023 09:33:31 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E4=BC=A0=E5=8F=82=E6=94=B9=E4=B8=BAcity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dags/business/community_summary_dag.py | 40 +++++++++++++------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/dags/business/community_summary_dag.py b/dags/business/community_summary_dag.py index 6cb1392..94523c0 100644 --- a/dags/business/community_summary_dag.py +++ b/dags/business/community_summary_dag.py @@ -12,83 +12,83 @@ with DAG( ) as dag: comm = BashOperator( task_id='comm', - bash_command='python /opt/airflow/dags/repo/dags/business/business/community/comm.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', + bash_command='python /opt/airflow/dags/repo/dags/business/business/community/comm.py {{dag_run.conf["city"] if "city" in dag_run.conf}}', ) price = BashOperator( task_id='price', - bash_command='python /opt/airflow/dags/repo/dags/business/business/community/price.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', + bash_command='python /opt/airflow/dags/repo/dags/business/business/community/price.py {{dag_run.conf["city"] if "city" in dag_run.conf}}', ) sell = BashOperator( task_id='sell', - bash_command='python /opt/airflow/dags/repo/dags/business/business/community/sell.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', + bash_command='python /opt/airflow/dags/repo/dags/business/business/community/sell.py {{dag_run.conf["city"] if "city" in dag_run.conf}}', ) avg_cost = BashOperator( task_id='avg_cost', - bash_command='python /opt/airflow/dags/repo/dags/business/business/community/avg_cost.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', + bash_command='python /opt/airflow/dags/repo/dags/business/business/community/avg_cost.py {{dag_run.conf["city"] if "city" in dag_run.conf}}', ) trade = BashOperator( task_id='trade', - bash_command='python /opt/airflow/dags/repo/dags/business/business/community/trade.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', + bash_command='python /opt/airflow/dags/repo/dags/business/business/community/trade.py {{dag_run.conf["city"] if "city" in dag_run.conf}}', ) total_price = BashOperator( task_id='total_price', - bash_command='python /opt/airflow/dags/repo/dags/business/business/community/total_price.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', + bash_command='python /opt/airflow/dags/repo/dags/business/business/community/total_price.py {{dag_run.conf["city"] if "city" in dag_run.conf}}', ) total_price_complete = BashOperator( task_id='total_price_complete', - bash_command='python /opt/airflow/dags/repo/dags/business/business/community/total_price_complete.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', + bash_command='python /opt/airflow/dags/repo/dags/business/business/community/total_price_complete.py {{dag_run.conf["city"] if "city" in dag_run.conf}}', ) traffic = BashOperator( task_id='traffic', - bash_command='python /opt/airflow/dags/repo/dags/business/business/community/traffic.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', + bash_command='python /opt/airflow/dags/repo/dags/business/business/community/traffic.py {{dag_run.conf["city"] if "city" in dag_run.conf}}', ) business_district = BashOperator( task_id='business_district', - bash_command='python /opt/airflow/dags/repo/dags/business/business/community/business_district.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', + bash_command='python /opt/airflow/dags/repo/dags/business/business/community/business_district.py {{dag_run.conf["city"] if "city" in dag_run.conf}}', ) medical = BashOperator( task_id='medical', - bash_command='python /opt/airflow/dags/repo/dags/business/business/community/medical.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', + bash_command='python /opt/airflow/dags/repo/dags/business/business/community/medical.py {{dag_run.conf["city"] if "city" in dag_run.conf}}', ) life = BashOperator( task_id='life', - bash_command='python /opt/airflow/dags/repo/dags/business/business/community/life.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', + bash_command='python /opt/airflow/dags/repo/dags/business/business/community/life.py {{dag_run.conf["city"] if "city" in dag_run.conf}}', ) relative_price_ranking = BashOperator( task_id='relative_price_ranking', - bash_command='python /opt/airflow/dags/repo/dags/business/business/community/relative_price_ranking.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', + bash_command='python /opt/airflow/dags/repo/dags/business/business/community/relative_price_ranking.py {{dag_run.conf["city"] if "city" in dag_run.conf}}', ) estate_charge_complete = BashOperator( task_id='estate_charge_complete', - bash_command='python /opt/airflow/dags/repo/dags/business/business/community/estate_charge_complete.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', + bash_command='python /opt/airflow/dags/repo/dags/business/business/community/estate_charge_complete.py {{dag_run.conf["city"] if "city" in dag_run.conf}}', ) estate_charge_ranking = BashOperator( task_id='estate_charge_ranking', - bash_command='python /opt/airflow/dags/repo/dags/business/business/community/estate_charge_ranking.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', + bash_command='python /opt/airflow/dags/repo/dags/business/business/community/estate_charge_ranking.py {{dag_run.conf["city"] if "city" in dag_run.conf}}', ) consumption = BashOperator( task_id='consumption', - bash_command='python /opt/airflow/dags/repo/dags/business/business/community/consumption.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', + bash_command='python /opt/airflow/dags/repo/dags/business/business/community/consumption.py {{dag_run.conf["city"] if "city" in dag_run.conf}}', ) price_rating = BashOperator( task_id='price_rating', - bash_command='python /opt/airflow/dags/repo/dags/business/business/community/price_rating.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', + bash_command='python /opt/airflow/dags/repo/dags/business/business/community/price_rating.py {{dag_run.conf["city"] if "city" in dag_run.conf}}', ) education = BashOperator( task_id='education', - bash_command='python /opt/airflow/dags/repo/dags/business/business/community/education.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', + bash_command='python /opt/airflow/dags/repo/dags/business/business/community/education.py {{dag_run.conf["city"] if "city" in dag_run.conf}}', ) education2 = BashOperator( task_id='education2', - bash_command='python /opt/airflow/dags/repo/dags/business/business/community/education2.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', + bash_command='python /opt/airflow/dags/repo/dags/business/business/community/education2.py {{dag_run.conf["city"] if "city" in dag_run.conf}}', ) extra = BashOperator( task_id='extra', - bash_command='python /opt/airflow/dags/repo/dags/business/business/community/extra.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', + bash_command='python /opt/airflow/dags/repo/dags/business/business/community/extra.py {{dag_run.conf["city"] if "city" in dag_run.conf}}', ) other = BashOperator( task_id='other', - bash_command='python /opt/airflow/dags/repo/dags/business/business/community/other.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', + bash_command='python /opt/airflow/dags/repo/dags/business/business/community/other.py {{dag_run.conf["city"] if "city" in dag_run.conf}}', ) comm >> price >> avg_cost >> total_price >> total_price_complete >> relative_price_ranking >> estate_charge_complete >> estate_charge_ranking \ >> consumption >> price_rating >> sell >> trade >> traffic >> business_district >> medical >> life >> education >> education2 >> extra >> other From 2141839762192343f30beaadc0558938154d7731 Mon Sep 17 00:00:00 2001 From: "shenjian@fangjia.com" Date: Tue, 21 Feb 2023 09:33:31 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E4=BC=A0=E5=8F=82=E6=94=B9=E4=B8=BAcity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dags/business/business/community/comm.py | 2 +- dags/business/community_summary_dag.py | 40 ++++++++++++------------ 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/dags/business/business/community/comm.py b/dags/business/business/community/comm.py index 7134e3d..5043402 100644 --- a/dags/business/business/community/comm.py +++ b/dags/business/business/community/comm.py @@ -96,7 +96,7 @@ def sync(city=None): sql = f"select id from {index_name} " if pd.notna(city): - sql += f" from city={city}" + sql += f" where city='{city}'" community_summary_df = es206_client.scan_by_sql_to_data_frame(sql) seaweed_df['_id'] = seaweed_df['_id'].astype(str) diff --git a/dags/business/community_summary_dag.py b/dags/business/community_summary_dag.py index 6cb1392..94523c0 100644 --- a/dags/business/community_summary_dag.py +++ b/dags/business/community_summary_dag.py @@ -12,83 +12,83 @@ with DAG( ) as dag: comm = BashOperator( task_id='comm', - bash_command='python /opt/airflow/dags/repo/dags/business/business/community/comm.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', + bash_command='python /opt/airflow/dags/repo/dags/business/business/community/comm.py {{dag_run.conf["city"] if "city" in dag_run.conf}}', ) price = BashOperator( task_id='price', - bash_command='python /opt/airflow/dags/repo/dags/business/business/community/price.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', + bash_command='python /opt/airflow/dags/repo/dags/business/business/community/price.py {{dag_run.conf["city"] if "city" in dag_run.conf}}', ) sell = BashOperator( task_id='sell', - bash_command='python /opt/airflow/dags/repo/dags/business/business/community/sell.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', + bash_command='python /opt/airflow/dags/repo/dags/business/business/community/sell.py {{dag_run.conf["city"] if "city" in dag_run.conf}}', ) avg_cost = BashOperator( task_id='avg_cost', - bash_command='python /opt/airflow/dags/repo/dags/business/business/community/avg_cost.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', + bash_command='python /opt/airflow/dags/repo/dags/business/business/community/avg_cost.py {{dag_run.conf["city"] if "city" in dag_run.conf}}', ) trade = BashOperator( task_id='trade', - bash_command='python /opt/airflow/dags/repo/dags/business/business/community/trade.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', + bash_command='python /opt/airflow/dags/repo/dags/business/business/community/trade.py {{dag_run.conf["city"] if "city" in dag_run.conf}}', ) total_price = BashOperator( task_id='total_price', - bash_command='python /opt/airflow/dags/repo/dags/business/business/community/total_price.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', + bash_command='python /opt/airflow/dags/repo/dags/business/business/community/total_price.py {{dag_run.conf["city"] if "city" in dag_run.conf}}', ) total_price_complete = BashOperator( task_id='total_price_complete', - bash_command='python /opt/airflow/dags/repo/dags/business/business/community/total_price_complete.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', + bash_command='python /opt/airflow/dags/repo/dags/business/business/community/total_price_complete.py {{dag_run.conf["city"] if "city" in dag_run.conf}}', ) traffic = BashOperator( task_id='traffic', - bash_command='python /opt/airflow/dags/repo/dags/business/business/community/traffic.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', + bash_command='python /opt/airflow/dags/repo/dags/business/business/community/traffic.py {{dag_run.conf["city"] if "city" in dag_run.conf}}', ) business_district = BashOperator( task_id='business_district', - bash_command='python /opt/airflow/dags/repo/dags/business/business/community/business_district.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', + bash_command='python /opt/airflow/dags/repo/dags/business/business/community/business_district.py {{dag_run.conf["city"] if "city" in dag_run.conf}}', ) medical = BashOperator( task_id='medical', - bash_command='python /opt/airflow/dags/repo/dags/business/business/community/medical.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', + bash_command='python /opt/airflow/dags/repo/dags/business/business/community/medical.py {{dag_run.conf["city"] if "city" in dag_run.conf}}', ) life = BashOperator( task_id='life', - bash_command='python /opt/airflow/dags/repo/dags/business/business/community/life.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', + bash_command='python /opt/airflow/dags/repo/dags/business/business/community/life.py {{dag_run.conf["city"] if "city" in dag_run.conf}}', ) relative_price_ranking = BashOperator( task_id='relative_price_ranking', - bash_command='python /opt/airflow/dags/repo/dags/business/business/community/relative_price_ranking.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', + bash_command='python /opt/airflow/dags/repo/dags/business/business/community/relative_price_ranking.py {{dag_run.conf["city"] if "city" in dag_run.conf}}', ) estate_charge_complete = BashOperator( task_id='estate_charge_complete', - bash_command='python /opt/airflow/dags/repo/dags/business/business/community/estate_charge_complete.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', + bash_command='python /opt/airflow/dags/repo/dags/business/business/community/estate_charge_complete.py {{dag_run.conf["city"] if "city" in dag_run.conf}}', ) estate_charge_ranking = BashOperator( task_id='estate_charge_ranking', - bash_command='python /opt/airflow/dags/repo/dags/business/business/community/estate_charge_ranking.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', + bash_command='python /opt/airflow/dags/repo/dags/business/business/community/estate_charge_ranking.py {{dag_run.conf["city"] if "city" in dag_run.conf}}', ) consumption = BashOperator( task_id='consumption', - bash_command='python /opt/airflow/dags/repo/dags/business/business/community/consumption.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', + bash_command='python /opt/airflow/dags/repo/dags/business/business/community/consumption.py {{dag_run.conf["city"] if "city" in dag_run.conf}}', ) price_rating = BashOperator( task_id='price_rating', - bash_command='python /opt/airflow/dags/repo/dags/business/business/community/price_rating.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', + bash_command='python /opt/airflow/dags/repo/dags/business/business/community/price_rating.py {{dag_run.conf["city"] if "city" in dag_run.conf}}', ) education = BashOperator( task_id='education', - bash_command='python /opt/airflow/dags/repo/dags/business/business/community/education.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', + bash_command='python /opt/airflow/dags/repo/dags/business/business/community/education.py {{dag_run.conf["city"] if "city" in dag_run.conf}}', ) education2 = BashOperator( task_id='education2', - bash_command='python /opt/airflow/dags/repo/dags/business/business/community/education2.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', + bash_command='python /opt/airflow/dags/repo/dags/business/business/community/education2.py {{dag_run.conf["city"] if "city" in dag_run.conf}}', ) extra = BashOperator( task_id='extra', - bash_command='python /opt/airflow/dags/repo/dags/business/business/community/extra.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', + bash_command='python /opt/airflow/dags/repo/dags/business/business/community/extra.py {{dag_run.conf["city"] if "city" in dag_run.conf}}', ) other = BashOperator( task_id='other', - bash_command='python /opt/airflow/dags/repo/dags/business/business/community/other.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', + bash_command='python /opt/airflow/dags/repo/dags/business/business/community/other.py {{dag_run.conf["city"] if "city" in dag_run.conf}}', ) comm >> price >> avg_cost >> total_price >> total_price_complete >> relative_price_ranking >> estate_charge_complete >> estate_charge_ranking \ >> consumption >> price_rating >> sell >> trade >> traffic >> business_district >> medical >> life >> education >> education2 >> extra >> other From f76043e0e36445c7803141970ee13c789f578a7b Mon Sep 17 00:00:00 2001 From: "shenjian@fangjia.com" Date: Tue, 21 Feb 2023 10:36:27 +0800 Subject: [PATCH 5/9] =?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/total_price_complete.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dags/business/business/community/total_price_complete.py b/dags/business/business/community/total_price_complete.py index a2f07a6..1c75677 100644 --- a/dags/business/business/community/total_price_complete.py +++ b/dags/business/business/community/total_price_complete.py @@ -62,6 +62,9 @@ def complete_by_build_year_area(community_factor_df): for index, build_year_area in build_year_area_df.iterrows(): build_year_area_dict[ build_year_area['city'] + '|' + build_year_area['region'] + "|" + build_year_area['buildyear']] = build_year_area['factor'] + # 修复按城市跑批数据字段可能不存在问题 + if 'finish_building_date' not in community_factor_df.columns or 'total_price' not in community_factor_df.columns: + return False for index, item in community_factor_df[ (community_factor_df['total_price'].isna()) & (community_factor_df['finish_building_date'].notna())].iterrows(): finish_building_date = item['finish_building_date'] From 544ab4fea90dbd8d025de3a59764b898eedcfff6 Mon Sep 17 00:00:00 2001 From: "shenjian@fangjia.com" Date: Tue, 21 Feb 2023 10:40:33 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/community/total_price_complete.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dags/business/business/community/total_price_complete.py b/dags/business/business/community/total_price_complete.py index 1c75677..4e82951 100644 --- a/dags/business/business/community/total_price_complete.py +++ b/dags/business/business/community/total_price_complete.py @@ -113,11 +113,11 @@ def sync(city=None): sql += " and city='" + city + "'" community_df = es206_client.scan_by_sql_to_data_frame(sql) - community_factor_df = complete_by_area(community_df) - complete_by_build_year_area(community_factor_df) - complete_by_region_area(community_factor_df) - - save(community_factor_df) + if len(community_df) > 0: + community_factor_df = complete_by_area(community_df) + complete_by_build_year_area(community_factor_df) + complete_by_region_area(community_factor_df) + save(community_factor_df) log.info(f"完成补全户均总价信息至206 {index_name}") From 0a15ed00e308388910dee2e3320290c86d9fd78e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=96=87=E8=89=B3?= Date: Wed, 22 Feb 2023 13:38:37 +0800 Subject: [PATCH 7/9] Update price_exception.py --- dags/jh/price/price_exception.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dags/jh/price/price_exception.py b/dags/jh/price/price_exception.py index dd55518..89f4c60 100644 --- a/dags/jh/price/price_exception.py +++ b/dags/jh/price/price_exception.py @@ -146,7 +146,7 @@ for index, item in city_count_df.iterrows(): city_count_df = city_count_df.rename(columns={'小区ID': '小区数量'}) city_count_df.to_excel(excel_writer, index=False, sheet_name='城市维度') -excel_writer.save() +#excel_writer.save() excel_writer.close() up_to_nextcloud() From 526f5a8de4e3bdada62d707ae8fd773249ea95f1 Mon Sep 17 00:00:00 2001 From: "shenjian@fangjia.com" Date: Thu, 23 Feb 2023 17:35:58 +0800 Subject: [PATCH 8/9] =?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 0694d6c..f0f9c39 100644 --- a/dags/business/business/community/trade.py +++ b/dags/business/business/community/trade.py @@ -33,6 +33,9 @@ def sync(city=None): seaweed_df = seaweed_df.reset_index(drop=True) deal_price_df = commutils.get_deal_avg_price(cities, 3) + if len(deal_price_df) <= 0: + 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'}) From c27e358f3ba33a0dd9bf2687f4b89e6e83d96fe1 Mon Sep 17 00:00:00 2001 From: "shenjian@fangjia.com" Date: Thu, 23 Feb 2023 17:43:40 +0800 Subject: [PATCH 9/9] =?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'})