Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions docs/getting_started/astro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ In your ``my_cosmos_dag.py`` file, import the ``DbtDag`` class from Cosmos and c
from cosmos import DbtDag, ProjectConfig, ProfileConfig, ExecutionConfig
from cosmos.profiles import PostgresUserPasswordProfileMapping

import os
from datetime import datetime

airflow_home = os.environ["AIRFLOW_HOME"]

profile_config = ProfileConfig(
profile_name="default",
target_name="dev",
Expand All @@ -101,11 +106,11 @@ In your ``my_cosmos_dag.py`` file, import the ``DbtDag`` class from Cosmos and c

my_cosmos_dag = DbtDag(
project_config=ProjectConfig(
"/usr/local/airflow/dags/my_dbt_project",
f"{airflow_home}/dags/my_dbt_project",
),
profile_config=profile_config,
execution_config=ExecutionConfig(
dbt_executable_path=f"{os.environ['AIRFLOW_HOME']}/dbt_venv/bin/dbt",
dbt_executable_path=f"{airflow_home}/dbt_venv/bin/dbt",
),
# normal dag parameters
schedule_interval="@daily",
Expand Down