优化定时
This commit is contained in:
@@ -16,7 +16,7 @@ with DAG(
|
|||||||
) as dag:
|
) as dag:
|
||||||
t1 = BashOperator(
|
t1 = BashOperator(
|
||||||
task_id='base_price',
|
task_id='base_price',
|
||||||
bash_command='python /opt/airflow/dags/repo/dags/office/rent/base_price.py',
|
bash_command='python /opt/airflow/dags/repo/dags/office/rent/base_price.py {{dag_run.conf["yearmonth"] if "yearmonth" in dag_run.conf}}',
|
||||||
)
|
)
|
||||||
t1
|
t1
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ from datetime import datetime
|
|||||||
from pymongo import UpdateOne
|
from pymongo import UpdateOne
|
||||||
import math
|
import math
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
import sys
|
||||||
|
|
||||||
es = ElasticSearchClient(host='192.168.0.206')
|
es = ElasticSearchClient(host='192.168.0.206')
|
||||||
seaweed_df = MAIN_MONGO_CLIENT.get_collection('fangjia', 'seaweed')
|
seaweed_df = MAIN_MONGO_CLIENT.get_collection('fangjia', 'seaweed')
|
||||||
@@ -304,7 +305,6 @@ def calc(city, year_month):
|
|||||||
actions.clear()
|
actions.clear()
|
||||||
office_rent_stat_conn.bulk_write(actions)
|
office_rent_stat_conn.bulk_write(actions)
|
||||||
|
|
||||||
for year_month in range(202406, 202501):
|
yearmonth = sys.argv[1] if len(sys.argv) > 1 else None
|
||||||
print(year_month)
|
|
||||||
calc(None, year_month)
|
calc(None, yearmonth)
|
||||||
#calc('上海', 202412)
|
|
||||||
Reference in New Issue
Block a user