From f7f1887fbef365ea5c62d546eb4c6dbac6665ed1 Mon Sep 17 00:00:00 2001 From: ugmuka <55133701+ugmuka@users.noreply.github.com> Date: Wed, 15 Nov 2023 20:55:08 +0900 Subject: [PATCH] Docs fix: add execution config to MWAA code example (#667) (#674) Add execution config to MWAA code example document. Closes: #667 (cherry picked from commit 773fa27b868c640d67576c85638362fd5d0feb9e) --- docs/getting_started/mwaa.rst | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/getting_started/mwaa.rst b/docs/getting_started/mwaa.rst index f7a569302..726cf0cb8 100644 --- a/docs/getting_started/mwaa.rst +++ b/docs/getting_started/mwaa.rst @@ -87,8 +87,9 @@ In your ``my_cosmos_dag.py`` file, import the ``DbtDag`` class from Cosmos and c .. code-block:: python - from cosmos import DbtDag, ProjectConfig, ProfileConfig + from cosmos import DbtDag, ProjectConfig, ProfileConfig, ExecutionConfig from cosmos.profiles import PostgresUserPasswordProfileMapping + from cosmos.constants import ExecutionMode profile_config = ProfileConfig( profile_name="default", @@ -99,11 +100,17 @@ In your ``my_cosmos_dag.py`` file, import the ``DbtDag`` class from Cosmos and c ), ) + execution_config = ExecutionConfig( + dbt_executable_path=f"{os.environ['AIRFLOW_HOME']}/dbt_venv/bin/dbt", + execution_mode=ExecutionMode.VIRTUALENV, + ) + my_cosmos_dag = DbtDag( project_config=ProjectConfig( "", ), profile_config=profile_config, + execution_config=execution_config, # normal dag parameters schedule_interval="@daily", start_date=datetime(2023, 1, 1),