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

docs: adds DBT concept documentation #111

Merged
merged 5 commits into from
Jan 25, 2024
Merged

docs: adds DBT concept documentation #111

merged 5 commits into from
Jan 25, 2024

Conversation

pomegranited
Copy link
Contributor

@pomegranited pomegranited commented Jan 23, 2024

Description

  1. Adds dbt concept documentation
  2. Updates the dbt extension how-to

Supporting information

Closes #68

and updates the DBT Extension how-to.
@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Jan 23, 2024
@openedx-webhooks
Copy link

Thanks for the pull request, @pomegranited! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

@pomegranited pomegranited requested a review from bmtcril January 23, 2024 05:28

To change which DBT packages are installed, use the following Tutor variables:

- **EXTRA_DBT_PACKAGES**: A list of pip dbt packages for Aspects to install. Add your custom ddt packages here.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: ddt -> dbt

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the preferred way to customize dbt is to change the DBT_REPOSITORY / DBT_BRANCH / DBT_REPOSITORY_PATH to your dbt project, and have that project make our dbt package a requirement. Is that you how you did it @Ian2012 ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, you can update it to point to the main branch (to be always up to date) but it's better to have a pinned version so we don't introduce breaking changes

Copy link
Contributor Author

@pomegranited pomegranited Jan 24, 2024

Choose a reason for hiding this comment

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

Oh interesting, I thought that EXTRA_DBT_PACKAGES was for adding custom dbt packages, rather than encouraging people to fork aspects-dbt or run with a different version?

Let me know which way it should read, and I'll update the recommendations here.

Copy link
Contributor

Choose a reason for hiding this comment

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

No, EXTRA_DBT_PACKAGES is a list of python requirement that will be installed before your custom version of aspects-dbt will be run.

While, you can change your DBT_REPOSITORY and create a little packages.yml with aspects-dbt as a package. This will allow you to have all the base functionality of aspects while creating your custom models without forking. See this commit for an example

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh cool, thank you for these details @Ian2012 ! I'll incorporate them here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@Ian2012 Ian2012 Jan 24, 2024

Choose a reason for hiding this comment

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

Great, just missing two pieces I forgot to mention. You can create the project with dbt init and you must update the dbt_project.yml file to use the aspects profile. Sorry for going forward, once this is added I think is good to go

Copy link
Contributor Author

Choose a reason for hiding this comment

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

docs/how-tos/dbt_extensions.rst Outdated Show resolved Hide resolved
docs/concepts/dbt.rst Outdated Show resolved Hide resolved
Copy link
Contributor

@Ian2012 Ian2012 left a comment

Choose a reason for hiding this comment

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

LGTM, just a couple of nits

* adds details about package profile, dependency versions
* changes formatting of pages for clarity
Copy link
Contributor

@bmtcril bmtcril left a comment

Choose a reason for hiding this comment

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

Two last little things then feel free to merge, thanks!


**Step 2. Link to aspects-dbt**

Aspects charts depend on the transforms in `aspects-dbt`_, so it's important that your ``dbt`` package also installs
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Aspects charts depend on the transforms in `aspects-dbt`_, so it's important that your ``dbt`` package also installs
Aspects charts depend on the transforms in `aspects-dbt`_, so it's important that your ``dbt`` package also installs the same version of `aspects-dbt`_ as your `tutor_contrib_aspects` plugin uses.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point -- I updated "step 2" to better illustrate what those package.yml values should be:

https://docsopenedxorg--111.org.readthedocs.build/projects/openedx-aspects/en/111/how-tos/dbt_extensions.html

packages:
- git: "https://github.com/openedx/aspects-dbt.git"
revision: v2.2

Copy link
Contributor

Choose a reason for hiding this comment

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

Should note here that it will also need to contain all of the contents of the aspects-dbt packages.yml too, I believe.

Copy link
Contributor

@Ian2012 Ian2012 Jan 24, 2024

Choose a reason for hiding this comment

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

Is it true? I don't think so. I've been using it with only the aspects-dbt for two other projects and it has shown no issues. I think dependencies are installed recursively

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bmtcril I think @Ian2012 is correct here.

I couldn't find docs that verify it, which I would expect to find if dbt dependencies didn't work like other package dependencies.

I also dug through the dbt packages on dbt hub to find an example. This demo project depends on dbt-codegen, which in turn depends on dbt-utils, but dbt-utils need not be present in the parent's packages.yml.

@pomegranited pomegranited force-pushed the jill/concept-dbt branch 2 times, most recently from b54d4b6 to 98da80b Compare January 25, 2024 02:54
@pomegranited pomegranited merged commit 157c345 into main Jan 25, 2024
3 checks passed
@pomegranited pomegranited deleted the jill/concept-dbt branch January 25, 2024 02:56
@openedx-webhooks
Copy link

@pomegranited 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Docs: Concepts - dbt
4 participants