修改目录

This commit is contained in:
Jian Shen
2022-06-20 16:00:29 +08:00
parent 14309f48e2
commit b59dbe23e7
3 changed files with 9 additions and 7 deletions
+2 -2
View File
@@ -11,10 +11,10 @@ with DAG(
) as dag:
t1 = BashOperator(
task_id='district_count_thirdavg_deal',
bash_command='python /opt/airflow/dags/repo/dags/stat/district_count_thirdavg_deal.py',
bash_command='python /opt/airflow/dags/repo/dags/stat/evaluate/district_count_thirdavg_deal.py',
)
t2 = BashOperator(
task_id='district_sell_property',
bash_command='python /opt/airflow/dags/repo/dags/stat/district_sell_property.py',
bash_command='python /opt/airflow/dags/repo/dags/stat/evaluate/district_sell_property.py',
)
t1 >> t2
@@ -1,4 +1,3 @@
"""
统计小区数量、近半年第三方均价、近半年成交信息
"""
@@ -6,12 +5,16 @@ import logging
from goojia_utils import MAIN_MONGO_CLIENT, ElasticSearchClient, dateutils
import pandas as pd
import datetime
import os
log = logging.getLogger(__name__)
df = pd.read_excel('/opt/airflow/dags/repo/dags/stat/evaluate/data/估值数据统计.xlsx')
year_month_day = dateutils.format_date(datetime.datetime.now())
aim_file_name = '/opt/airflow/dags/repo/dags/stat/evaluate/data/估值数据统计结果' + year_month_day + '.xlsx'
path = "/home/airflow/data/evaluate"
aim_file_name = path + '/估值数据统计结果' + year_month_day + '.xlsx'
if not os.path.exists(path):
os.makedirs(path)
seaweed_conn = MAIN_MONGO_CLIENT.get_collection('fangjia', 'seaweed')
es206_client = ElasticSearchClient(host='192.168.0.206')
@@ -119,4 +122,4 @@ log.info("开始统计小区数量、近半年第三方均价、近半年成交
count_stat()
third_avg_stat()
deal_stat()
log.info("完成统计小区数量、近半年第三方均价、近半年成交信息")
log.info("完成统计小区数量、近半年第三方均价、近半年成交信息")
+1 -2
View File
@@ -9,7 +9,7 @@ import datetime
log = logging.getLogger(__name__)
year_month_day = dateutils.format_date(datetime.datetime.now())
aim_file_name = '/opt/airflow/dags/repo/dags/stat/evaluate/data/估值数据统计结果' + year_month_day + '.xlsx'
aim_file_name = '/home/airflow/data/evaluate/估值数据统计结果' + year_month_day + '.xlsx'
start_time = dateutils.format_date(dateutils.add_months(dateutils.datetime.datetime.now(), days=-181))
one_year_time = dateutils.format_date(dateutils.add_months(dateutils.datetime.datetime.now(), days=-366))
@@ -19,7 +19,6 @@ es206_client = ElasticSearchClient(host='192.168.0.206')
seaweed_df = pd.DataFrame(list(seaweed_conn.find({'cat': 'district', 'status': 0}, {'city': 1, 'region': 1, 'name': 1, 'alias': 1})
.batch_size(10000)))
def sell_stat():
"""
最近一年有样本小区占比 最近3月有样本小区占比