优化定时
This commit is contained in:
@@ -16,7 +16,7 @@ with DAG(
|
||||
) as dag:
|
||||
t1 = BashOperator(
|
||||
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
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ from datetime import datetime
|
||||
from pymongo import UpdateOne
|
||||
import math
|
||||
import numpy as np
|
||||
import sys
|
||||
|
||||
es = ElasticSearchClient(host='192.168.0.206')
|
||||
seaweed_df = MAIN_MONGO_CLIENT.get_collection('fangjia', 'seaweed')
|
||||
@@ -304,7 +305,6 @@ def calc(city, year_month):
|
||||
actions.clear()
|
||||
office_rent_stat_conn.bulk_write(actions)
|
||||
|
||||
for year_month in range(202406, 202501):
|
||||
print(year_month)
|
||||
calc(None, year_month)
|
||||
#calc('上海', 202412)
|
||||
yearmonth = sys.argv[1] if len(sys.argv) > 1 else None
|
||||
|
||||
calc(None, yearmonth)
|
||||
Reference in New Issue
Block a user