-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add quickstart example for dbt & Dagster #21240
Add quickstart example for dbt & Dagster #21240
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @maximearmstrong and the rest of your teammates on Graphite |
c40f38a
to
962ba18
Compare
bc5c6c8
to
e95f9e3
Compare
962ba18
to
03888c5
Compare
b146c7f
to
86de03d
Compare
03888c5
to
082265a
Compare
82d4a19
to
a9d5138
Compare
|
||
--- | ||
|
||
## Step 2: Create your code location file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice if we could model this how we've structured our other quickstart projects:
https://github.com/dagster-io/dagster/tree/master/examples/quickstart_snowflake
That way we can have a user scaffold the project using the template:
pip install dagster
dagster project from-example \
--name my-dagster-project \
--example quickstart_dbt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is what we did for our Dagster University dbt starter project:
https://github.com/dagster-io/dagster/tree/master/examples/project_du_dbt_starter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, I'd like to defer away from having users copy+paste large code snippets. ack that we have a history of it, but we can be better.
though I'm okay with not doing this until we un-experimentalize DbtProject
and can merge/deprecate the existing dbt example project we have.
082265a
to
c3d66ba
Compare
a9d5138
to
c20e75b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm in favor of this change. But two things:
- We should model this on our existing
dagster-dbt project scaffold
entrypoint. - The quickstart should just be a subset of the tutorial.
I'm also imagining two quickstart guides:
- A quickstart for a brand new Dagster project
- A quickstart to integrate into an existing Dagster project
For (1), if they don't have an existing Dagster project, they can use the outputs of the dagster-dbt project scaffold
CLI wholesale.
Essentially, we just need to copy/paste steps 1/2/3 from https://docs.dagster.io/integrations/dbt/using-dbt-with-dagster/load-dbt-models.
For (2), if they already have an existing Dagster project, we can just tell them to copy and paste the relevant bits from the generated scaffold to their existing project.
We should split (1) and (2) into separate PRs.
Note that I plan to chime in once the direction of this is a bit more solid. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good and I'm excited for this!
Most of my comments are nits, the only one that I'd really like addressed is the one about the What's next?
1. To start Dagster's UI, run the following: | ||
|
||
```shell | ||
dagster dev -f definitions.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might want to call out that this is assuming that they followed our directive of calling the file definitions.py
, probably up top where it's first defined.
dbt_assets, | ||
) | ||
|
||
RELATIVE_PATH_TO_YOUR_DBT_PROJECT = "relative/path/to/your/dbt-project" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I think our users might benefit from some additional hand-holding here.
How do you feel about either:
- instructing them to make this file in/adjacent to the dbt project dir?
- or giving a more precise example of what the path could be?
In this example, we created a single file to handle a simple use case and run your dbt project. To learn more about our dbt integrations and how to handle more complex use cases, consider the following options: | ||
|
||
- Begin the official dbt scaffold tutorial, like the [dbt & Dagster project](/integrations/dbt/using-dbt-with-dagster). | ||
- Checkout out the Dagster & dbt course in [Dagster University](https://courses.dagster.io). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our users might hit some decision paralysis here. Which one should they do in what situation and why?
@rexledesma @tacastillo @cmpadden These are very good points. I think using the scaffold would make sense in the quickstart. Maybe we could have a quickstart section and another one for the copy-paste code snippets? Or maybe we want to avoid copy+paste code altogether? The goal of Lopp's internal ticket was to add a section where a user could simply copy+paste code. @slopp What is your take on this? Would a quick start page with a subset of the tutorial be useful in the context you had in mind? Has this request been made by users? |
Ah if that's the scope of the original ask, then yeah I'm down for splitting concerns to prevent creep. will wait for the verdict, but otherwise, feel free to hit re-request review |
Scaffolding is nice and should be encouraged to use, but it sometimes feels heavy to certain new users. But I think having a single file that's copy+paste-able is good - It's handy for us to share how it looks and it's easier for users without a lot of time/patience to digest. So, maybe a path forward is:
Other than that, I agree with all the points made about scaffold and two paths of quickstart. |
c3d66ba
to
35923aa
Compare
c20e75b
to
1f290e7
Compare
35923aa
to
662d7d0
Compare
54ed678
to
88b03c6
Compare
## Summary & Motivation This PR updates the quickstart example for dbt + Dagster - it adds the steps to create a brand new Dagster project using the scaffold to wrap a dbt project. This work is the continuation of #21240 ## How I Tested These Changes BK + local ``` make mdx-full-format make next-watch-build ```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sweet, see nits before merging
@@ -0,0 +1,264 @@ | |||
--- | |||
title: "Quickstart: Run your dbt project with Dagster" | |||
description: Get started swiftly with this simple dbt + Dagster example. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: no +
since that's might be confused with Dagster+
description: Get started swiftly with this simple dbt + Dagster example. | |
description: Get started swiftly with this simple dbt & Dagster example. |
<Note> | ||
<strong>Note</strong>: This guide uses the <code>DbtProject</code> class, | ||
which is an experimental feature. Visit the{" "} | ||
<a href="/\_apidocs/libraries/dagster-dbt"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should link to the class directly
https://docs.dagster.io/
<a href="/\_apidocs/libraries/dagster-dbt"> | |
<a href="/\_apidocs/libraries/dagster-dbt#dagster_dbt.DbtProject"> |
for more info. | ||
</Note> | ||
|
||
If you just want to see the code of the example, skip to the **Create a single Dagster file** section. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sentence can probably can be omitted, given that it's the default option in "Load your dbt project"
info. | ||
</Note> | ||
|
||
Install dbt, Dagster, and the Dagster webserver/UI\*\*. Run the following to install everything using pip: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Install dbt, Dagster, and the Dagster webserver/UI\*\*. Run the following to install everything using pip: | |
Install dbt, Dagster, and the Dagster webserver\*\*. Run the following to install everything using pip: |
## Summary & Motivation This PR adds a quickstart example for dbt & Dagster. A user that wants to skip the tutorial can copy and paste the code included in the example and run `dagster dev`. This example includes the new experimental class `DbtProject`. Another PR will add more DbtProject examples in the dbt docs and notes that the feature is still experimental. ## How I Tested These Changes BK + local ``` make mdx-full-format make next-watch-build ```
## Summary & Motivation This PR adds a quickstart example for dbt & Dagster. A user that wants to skip the tutorial can copy and paste the code included in the example and run `dagster dev`. This example includes the new experimental class `DbtProject`. Another PR will add more DbtProject examples in the dbt docs and notes that the feature is still experimental. ## How I Tested These Changes BK + local ``` make mdx-full-format make next-watch-build ```
Summary & Motivation
This PR adds a quickstart example for dbt & Dagster. A user that wants to skip the tutorial can copy and paste the code included in the example and run
dagster dev
.This example includes the new experimental class
DbtProject
. Another PR will add more DbtProject examples in the dbt docs and notes that the feature is still experimental.How I Tested These Changes
BK
+
local