From 1cffdcafd8841b96ee622a49d9ae8f6716c55831 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 23 Dec 2021 18:39:06 +0100 Subject: [PATCH] docs: Minor doc updates to mention support for dbt docs --- README.md | 1 + examples/dbt_project_in_s3_dag.py | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4ea63bf..2c5b7d9 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,7 @@ Currently, the following `dbt` commands are supported: * `compile` * `debug` * `deps` +* `docs generate` * `ls` * `parse` * `run` diff --git a/examples/dbt_project_in_s3_dag.py b/examples/dbt_project_in_s3_dag.py index f5fe5df..cd37ffd 100644 --- a/examples/dbt_project_in_s3_dag.py +++ b/examples/dbt_project_in_s3_dag.py @@ -3,7 +3,7 @@ from airflow import DAG from airflow.utils.dates import days_ago -from airflow_dbt_python.dbt.operators import DbtRunOperator +from airflow_dbt_python.dbt.operators import DbtDocsGenerateOperator, DbtRunOperator with DAG( dag_id="example_basic_dbt_run_with_s3", @@ -12,6 +12,7 @@ catchup=False, dagrun_timeout=dt.timedelta(minutes=60), ) as dag: + # Project files will be pulled from "s3://my-bucket/dbt/profiles/key/prefix/" dbt_run = DbtRunOperator( task_id="dbt_run_hourly", project_dir="s3://my-bucket/dbt/project/key/prefix/", @@ -22,3 +23,13 @@ profile="my-project", full_refresh=False, ) + + # Documentation files (target/manifest.json, target/index.html, and + # target/catalog.json) will be pushed back to S3 after compilation is done. + dbt_docs = DbtDocsGenerateOperator( + task_id="dbt_run_hourly", + project_dir="s3://my-bucket/dbt/project/key/prefix/", + profiles_dir="s3://my-bucket/dbt/profiles/key/prefix/", + ) + + dbt_run >> dbt_docs