-
Notifications
You must be signed in to change notification settings - Fork 15
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
Use dbt package for tests and reload manifest #66
Use dbt package for tests and reload manifest #66
Conversation
Your pull request is automatically being deployed to Dagster Cloud.
|
hooli_data_eng/resources/__init__.py
Outdated
@@ -64,6 +64,12 @@ def get_env(): | |||
# Similar to having different dbt targets, here we create the resource | |||
# configuration by environment | |||
|
|||
dbt_resource = DbtCliResource( |
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 is a little confusing to me, this resource is only used in the local case right? And only for manifest generation? Whereas the other resources here, including the other use of dbt, are all specific to local, branch, or prod.
I'd maybe consider moving this to within the if block you added
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.
great callout, wasn't satisfied with this overall (I was following the examples in Dagster & dbt for consistency, but what I actually wanted was to use the DbtArtifact
class I mentioned in the comments. With an assist in Slack I was able to get that up and running 🎉 ,so this code is gone now
hooli_data_eng/assets/dbt_assets.py
Outdated
@@ -24,6 +24,7 @@ | |||
) | |||
from dagster_dbt.asset_decorator import dbt_assets | |||
from dagster._utils import file_relative_path | |||
from ..resources import dbt_resource |
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 would generally prefer absolute reference paths
hooli_data_eng.resources
or whatever
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 code is gone now but 👍 for the future
I definitely agree -- this is a dbt thing, so in the spirit of matching what you would see this test called in dbt I wasn't sure if we should change it. I'm open to a re-naming it, especially for demo purposes.
Yeah, it's relatively uninformative tbh -- right now it just tells you it fails. If we want to get a bit more fancy, we could likely read in the |
added the column schema info (pairs nicely with this PR as it adds a dbt package dagster to emit the schema. Taken from here: https://docs.dagster.io/integrations/dbt/reference#emit-column-schema-as-materialization-metadata- It just works! Will want to see it in Snowflake as well as duckdb |
- dbt_expectations.expect_column_values_to_match_like_pattern_list: | ||
like_pattern_list: ["%Sport%","%Co%","%Ltd%", "%Shop%"] | ||
match_on: any # (Optional. Default is 'any', which applies an 'OR' for each pattern. If 'all', it applies an 'AND' for each regex.) | ||
alias: example_alias |
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 take it the alias didn't work? (I wasn't sure if it would with tests)
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 have uncommitted changes for how to do it with dbt models and asset names, but yeah it looks like it would require changes to the Dagster-dbt library for test result aliases.
Same story for test result metadata, though I think we could get it by accessing the raw_event_stream and then appending the output to the AssetCheckResult
I’d be good with merging
|
…://github.com/dagster-io/hooli-data-eng-pipelines into christian-use-dbt-package-and-reload-manifest
This PR does 2 things related to our use of dbt in the hooli project:
make manifest
in because we will still need it for deployment for productionOne note: I tried to use the new experimental DbtArtifacts class from
1.6.9
but it did not work -- it looks like it will need to expose all options of theDbtCliResource
(right now I don't see a good way to set theprofiles-dir
argument in that class). Will post about it and see if that's expected.The code that didn't work looked like this: