diff --git a/docs/how-tos/dbt_extensions.rst b/docs/how-tos/dbt_extensions.rst index 470b178..ab254c7 100644 --- a/docs/how-tos/dbt_extensions.rst +++ b/docs/how-tos/dbt_extensions.rst @@ -16,7 +16,7 @@ Step 0. Install dbt core The easiest way to install dbt core is to use pip in a python3 virtual environment. -See `aspects/requirements.txt`_ for the specific package versions used by Aspects. +See `aspects-dbt requirements.txt`_ for the specific package versions used by Aspects. .. code-block:: bash @@ -57,6 +57,15 @@ Update the generated ``dbt_project.yml`` to use the ``aspects`` profile: # This setting configures which "profile" dbt uses for this project. profile: 'aspects' + +Also set the location for compiled SQL to match that used by ``aspects``: + +.. code-block:: yaml + + # directory which will store compiled SQL files + target-path: "target" + + Step 3. Link to aspects-dbt =========================== @@ -80,6 +89,9 @@ Step 4. Add your custom transforms Here is where you will need an understanding of dbt, Clickhouse, Aspects' data schemas, and the specific transforms you want to create. +If you need any python dependencies beyond what is provided by aspects-dbt, add these to a ``requirements.txt`` file at +the top level of your repository. + .. note:: You can use Aspects to debug your custom SQL: #. Login to Superset as an Open edX superuser. @@ -131,7 +143,7 @@ dbt generic tests are defined as SQL files, where the goal of the SQL statement Because our new `average_attempts` model aggregates on `actor_id` and `problem_id`, it should only have 1 entry for each `problem_id`. So our test can be: -.. code-block: sql +.. code-block:: -- average_attempts should only have one record for each problem_id. select @@ -214,7 +226,7 @@ References .. _aspects-dbt: https://github.com/openedx/aspects-dbt .. _aspects-dbt-example: https://github.com/open-craft/aspects-dbt-example .. _aspects-dbt-example#1: https://github.com/open-craft/aspects-dbt-example/pull/1 -.. _aspects/requirements.txt: https://github.com/openedx/tutor-contrib-aspects/blob/main/tutoraspects/templates/aspects/build/aspects/requirements.txt +.. _aspects-dbt requirements.txt: https://github.com/openedx/aspects-dbt/blob/main/requirements.txt .. _About dbt init: https://docs.getdbt.com/reference/commands/init .. _About dbt models: https://docs.getdbt.com/docs/build/models .. _Best practice guides: https://docs.getdbt.com/best-practices