Closed dinigo closed 2 years ago
Hello! The functionality is there. We've tested it with a DAG like this
with DAG('dbt_dag_example', start_date=datetime(2021, 10, 1)) as dag:
# If no hook is provided, it defaults to the local execution hook
DbtRunOperator(
task_id='run_dbt_cli',
project_dir=abspath('./jaffle-shop'),
profiles_dir=abspath('.'),
dbt_bin='/home/airflow/.local/bin/dbt',
# local environment need to define the env variable for auth
env={ 'GOOGLE_APPLICATION_CREDENTIALS': '/run/secrets/gcp_credentials.json'},
)
DbtRunOperator(
task_id='run_dbt_cloud_build',
project_dir='jaffle-shop',
profiles_dir='jaffle-shop',
dbt_hook=DbtCloudBuildHook(
project_id='datatonic-uk-dop-dev',
gcs_staging_location='gs://some_bucket/jaffle-shop.tar.gz',
)
)
@andrewrjones @etoulas : Could you assist me in getting this PR merged? if this repo is not going to be maintained I'll be happy to do so
This was closed when I renamed the main branch In my repo :/
Closes #44
This extracts the execution from the
DbtHook
. Defaults the Operators behaviour. It does not break the API. But in case the user needs another environment you can pass it a different hook with custom configuration.