diff --git a/docs/getting_started/astro.rst b/docs/getting_started/astro.rst index 2c0845d0d1..3632cda252 100644 --- a/docs/getting_started/astro.rst +++ b/docs/getting_started/astro.rst @@ -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 `__ 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(), ), # ..., )