-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[dagster-dbt] add with_snowflake/bigquery_insights
chainable method
#23183
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @benpankow and the rest of your teammates on Graphite |
with_snowflake/bigquery_insights
chainable method
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.
Can we just have one function, with_insights
? We can determine whether the target is snowflake
or bigquery
from the execution manifest
Also, instead of an import time error, maybe we could raise a warning instead, so core execution doesn't fail? We should also add a test in the OSS context (the warning is thrown since dagster-cloud
isn't installed)
Good call; updated.
My bias is for the code to explicitly error here just so there's no silent failure or other unexpected behavior - in the case that a user is conditionally using different warehouses, I think they can just conditionally call this method. They'd have to do a fair amount of conditional logic (manifest, target) elsewhere anyway. |
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.
Seems like we should just universally have the config check enabled? That way, we can remove it as an argument. But we should probably ensure that check is done at the start of the dbt cli invocation so that things fail fast.
Not a blocker to get this initial scaffold in though
python_modules/libraries/dagster-dbt/dagster_dbt/core/resource.py
Outdated
Show resolved
Hide resolved
20c7e81
to
a561f57
Compare
…#23183) ## Summary Adds a `with_snowflake_insights` and `with_bigquery_insights` methods that can be chained to a `.stream()` call, simplifying using insights alongside other deferred fetches: Before: ```python @dbt_assets(manifest=snowflake_manifest_path) def jaffle_shop_dbt_assets( context: AssetExecutionContext, dbt: DbtCliResource, ): dbt_cli_invocation = dbt.cli(["build", "--profile", "unittest"], context=context) yield from dbt_with_snowflake_insights(context, dbt_cli_invocation) ``` Now: ```python @dbt_assets(manifest=snowflake_manifest_path) def jaffle_shop_dbt_assets( context: AssetExecutionContext, dbt: DbtCliResource, ): yield from dbt.cli( ["build", "--profile", "unittest"], context=context ).stream().with_snowflake_insights() ``` ## Test Plan dagster-io/internal#10731
## Summary Adds docs for the new insights API introduced in #23183
Adds docs for the new insights API introduced in #23183
Summary
Adds a
with_snowflake_insights
andwith_bigquery_insights
methods that can be chained to a.stream()
call, simplifying using insights alongside other deferred fetches:Before:
Now:
Test Plan
https://github.com/dagster-io/internal/pull/10731