-
-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathbasic_dag.py
More file actions
29 lines (24 loc) · 767 Bytes
/
basic_dag.py
File metadata and controls
29 lines (24 loc) · 767 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
"""Sample basic DAG which dbt runs a project."""
import datetime as dt
import pendulum
# from airflow.sdk import DAG in >=3.1
from airflow.providers.common.compat.sdk import DAG
from airflow_dbt_python.operators.dbt import DbtRunOperator
with DAG(
dag_id="example_basic_dbt",
schedule=None,
start_date=pendulum.today("UTC").add(days=-1),
catchup=False,
dagrun_timeout=dt.timedelta(minutes=60),
default_args={"retries": 2},
) as dag:
dbt_run = DbtRunOperator(
task_id="dbt_run_hourly",
project_dir="/path/to/my/dbt/project/",
profiles_dir="~/.dbt/",
select=["+tag:hourly"],
exclude=["tag:deprecated"],
target="production",
profile="my-project",
full_refresh=False,
)