Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: dbt requirements have moved to aspects-dbt #225

Merged
merged 2 commits into from
Jun 20, 2024
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
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.

Comment on lines +92 to +94
Copy link
Contributor Author

@pomegranited pomegranited Jun 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: this change makes the dbt requirements.txt file optional.

.. 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