dbt: test models selector

Signed-off-by: Alexis Pentori <alexis@status.im>
This commit is contained in:
Alexis Pentori 2024-02-02 10:18:14 +01:00
parent d2d13c0a22
commit 225db506fa
No known key found for this signature in database
GPG Key ID: 65250D2801E47A10
1 changed files with 9 additions and 0 deletions

9
dbt.py
View File

@ -7,6 +7,7 @@ import sys
from airflow.decorators import dag, task
from airflow.operators.python import get_current_context
from airflow.operators.bash_operator import BashOperator
from airflow.models.param import Param
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
@ -38,3 +39,11 @@ def dbt_models():
)
dbt_models()
@dag('dbt_select_models', params={ "model": Param("status_bi", type="string")} , default_args=ARGS,schedule_interval=None)
def dbt_select_models():
BashOperator(
task_id='dbt_postgres_run',
bash_command='dbt run --profiles-dir /dbt --project-dir /dbt/dbt-models --select {{ params.model}}',
)
dbt_select_models()