From f4b5b241aa46482befa8c00279d9e15f77f13c80 Mon Sep 17 00:00:00 2001 From: Jillian Vogel Date: Fri, 14 Jun 2024 11:38:00 +0930 Subject: [PATCH 1/2] fix: dbt requirements have moved to aspects-dbt and a malformed code block. --- docs/how-tos/dbt_extensions.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/how-tos/dbt_extensions.rst b/docs/how-tos/dbt_extensions.rst index 470b178..f6f131e 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 @@ -131,7 +131,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 +214,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 From 946989d2937d232508afff701e777ec3f96633b3 Mon Sep 17 00:00:00 2001 From: Jillian Vogel Date: Thu, 20 Jun 2024 16:41:45 +0930 Subject: [PATCH 2/2] docs: mention the requirements.txt file which should be optional --- docs/how-tos/dbt_extensions.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/how-tos/dbt_extensions.rst b/docs/how-tos/dbt_extensions.rst index f6f131e..ab254c7 100644 --- a/docs/how-tos/dbt_extensions.rst +++ b/docs/how-tos/dbt_extensions.rst @@ -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.