-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6e777b0
commit 0841817
Showing
3 changed files
with
44 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from pathlib import Path | ||
|
||
from airflow import DAG | ||
from airflow.operators.empty import EmptyOperator | ||
from airflow.utils.dates import days_ago | ||
|
||
from opendbt.airflow import OpenDbtAirflowProject | ||
|
||
default_args = { | ||
'owner': 'airflow', | ||
'depends_on_past': False, | ||
'email_on_failure': False, | ||
'email_on_retry': False, | ||
'retries': 1 | ||
} | ||
|
||
with DAG( | ||
dag_id='dbt_tests_workflow', | ||
default_args=default_args, | ||
description='DAG To run dbt tests', | ||
schedule_interval=None, | ||
start_date=days_ago(3), | ||
catchup=False, | ||
max_active_runs=1 | ||
) as dag: | ||
start = EmptyOperator(task_id="start") | ||
end = EmptyOperator(task_id="end") | ||
|
||
DBT_PROJ_DIR = Path("/opt/dbttest") | ||
|
||
p = OpenDbtAirflowProject(project_dir=DBT_PROJ_DIR, profiles_dir=DBT_PROJ_DIR, target='dev') | ||
p.load_dbt_tasks(dag=dag, start_node=start, end_node=end, resource_type='test') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters