32 lines
852 B
Python
32 lines
852 B
Python
"""
|
|
小区周边配套DAG
|
|
"""
|
|
from airflow.operators.bash import BashOperator
|
|
from airflow.operators.python import PythonOperator
|
|
from office.rent.base_price import calc
|
|
|
|
import pendulum
|
|
|
|
from airflow import DAG
|
|
|
|
with DAG(
|
|
dag_id="office_rent_dag",
|
|
# 每月25日1点运行
|
|
schedule_interval="0 3 26 * *",
|
|
start_date=pendulum.datetime(2025, 3, 26, tz="Asia/Shanghai"),
|
|
catchup=True,
|
|
description="写字楼租金价格计算",
|
|
tags=["office", "rent"],
|
|
) as dag:
|
|
t1 = BashOperator(
|
|
task_id='office_city_region_rent_calc',
|
|
bash_command='python /opt/airflow/dags/repo/dags/office/rent/price.py {{dag_run.conf["yearmonth"] if "yearmonth" in dag_run.conf}} ',
|
|
)
|
|
t2 = PythonOperator(
|
|
task_id='office_base_rent_calc',
|
|
python_callable=calc,
|
|
provide_context=True
|
|
)
|
|
t1 >> t2
|
|
|