From d4a0ecc971637031ab251073f264bcfed37ac4f7 Mon Sep 17 00:00:00 2001 From: "shenjian@fangjia.com" Date: Wed, 10 May 2023 15:16:48 +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/business/business/community/relative_price_fix.py | 5 +++-- dags/business/dag_community_summary.py | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/dags/business/business/community/relative_price_fix.py b/dags/business/business/community/relative_price_fix.py index d1a33cd..5e06a68 100644 --- a/dags/business/business/community/relative_price_fix.py +++ b/dags/business/business/community/relative_price_fix.py @@ -3,9 +3,8 @@ """ import logging import pandas as pd -from goojia_utils import ElasticSearchClient, commutils, dateutils, data_utils +from goojia_utils import ElasticSearchClient, dateutils, data_utils from elasticsearch import helpers -from concurrent.futures import ThreadPoolExecutor import sys from threading import Lock @@ -60,6 +59,8 @@ def sync(city=None): actions.clear() if len(actions) > 0: helpers.bulk(es206_client.elastic_client, actions) + count += len(actions) + log.info("更新:" + str(count)) actions.clear() log.info("完成调整相对价格排名数据...") diff --git a/dags/business/dag_community_summary.py b/dags/business/dag_community_summary.py index e7d100e..e69b2df 100644 --- a/dags/business/dag_community_summary.py +++ b/dags/business/dag_community_summary.py @@ -58,6 +58,10 @@ with DAG( task_id='relative_price_ranking', 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}}', ) + relative_price_ranking_fix = BashOperator( + task_id='relative_price_ranking_fix', + bash_command='python /opt/airflow/dags/repo/dags/business/business/community/relative_price_ranking_fix.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["city"] if "city" in dag_run.conf}}', @@ -103,4 +107,4 @@ with DAG( 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, relative_price_ranking, estate_charge_complete] >> total_price_complete >> consumption >> credit >> [estate_charge_ranking, price_rating, person_rating, percentile] >> sell >> trade >> [traffic, business_district, medical, life, education] >> education2 >> extra >> other + comm >> price >> [avg_cost, total_price, relative_price_ranking, estate_charge_complete] >> [total_price_complete, relative_price_ranking_fix] >> consumption >> credit >> [estate_charge_ranking, price_rating, person_rating, percentile] >> sell >> trade >> [traffic, business_district, medical, life, education] >> education2 >> extra >> other