Skip to content

Commit

Permalink
Docs fix: add execution config to MWAA code example (astronomer#667) (a…
Browse files Browse the repository at this point in the history
…stronomer#674)

Add execution config to MWAA code example document.

Closes: astronomer#667
  • Loading branch information
ugmuka authored and arojasb3 committed Jul 14, 2024
1 parent 077728b commit ad8a9b8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion docs/getting_started/mwaa.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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(
"<my_dbt_project>",
),
profile_config=profile_config,
execution_config=execution_config,
# normal dag parameters
schedule_interval="@daily",
start_date=datetime(2023, 1, 1),
Expand Down

0 comments on commit ad8a9b8

Please sign in to comment.