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: 6 additions & 3 deletions docs/getting_started/astro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,20 @@ Make a new folder, ``dbt``, inside your local project's ``dags`` folder. Then, c
├── requirements.txt
└── ...

Note: your dbt projects can go anywhere on the Airflow image. By default, Cosmos looks in the ``/usr/local/airflow/dags/dbt`` directory, but you can change this by setting the ``dbt_project_dir`` argument when you create your DAG instance.
Note: dbt projects can be placed anywhere in the Airflow image or mounted independently via the `astro dbt deploy <https://www.astronomer.io/docs/astro/cli/astro-dbt-deploy>`__ command. You can customise where the dbt project is by setting the ``dbt_project_path`` parameter on ``ProjectConfig`` when you create your DAG instance.

For example, if you wanted to put your dbt project in the ``/usr/local/airflow/dags/my_dbt_project`` directory, you would do:
For example, if you wanted to put your dbt project in a directory relative to your DAG file (for example, ``dbt/my_dbt_project``, corresponding to ``dags/dbt/my_dbt_project`` in your project), you would do:

.. code-block:: python

from pathlib import Path
from cosmos import DbtDag, ProjectConfig

my_cosmos_dag = DbtDag(
project_config=ProjectConfig(
dbt_project_path="/usr/local/airflow/dags/my_dbt_project",
dbt_project_path=(Path(__file__).parent / "dbt/my_dbt_project")
.absolute()
.as_posix(),
Comment thread
tatiana marked this conversation as resolved.
),
# ...,
)
Expand Down
Loading