Skip to content

Commit

Permalink
Generalise example from README (#1311)
Browse files Browse the repository at this point in the history
  • Loading branch information
ReadytoRocc authored Nov 7, 2024
1 parent 489195a commit 1840c32
Showing 1 changed file with 7 additions and 2 deletions.
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

0 comments on commit 1840c32

Please sign in to comment.