Skip to content

Commit

Permalink
Merge pull request #225 from openedx/jill/fix-extend-dbt
Browse files Browse the repository at this point in the history
fix: dbt requirements have moved to aspects-dbt
  • Loading branch information
bmtcril authored Jun 20, 2024
2 parents db8d976 + 946989d commit e102221
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions docs/how-tos/dbt_extensions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
===========================

Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e102221

Please sign in to comment.