-
Notifications
You must be signed in to change notification settings - Fork 74
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
Warn for dbt snapshot configurations containing target_schema
or target_database
#477
Comments
Is it really the remit of this package? I feel like it should come as a warning from dbt Core directly, no? I view this package more as a modelling best practice packages, not so much of a configuration best practice one. |
If it doesn't go in either Core or dbt-project-evaluator, is there any other place you think it could go? When @Grace, Gerda, Michelle and myself discussed this, we decided not to raise a warning in dbt Core. We were hoping/thinking that project evaluator might be a good mechanism for this particular best practice (read below for more details). More detailsIf we were going to deprecate dbt Core has generally not raised warnings for best practices, and we've typically reserved
|
I definitely don't want to have to define new rules every time a field is not a best practice anymore but could maybe buy creating one single rule where we would bundle all the config that used to be standard and is not recommended anymore. But one of the problems with this approach is that I guess that most dbt users don't install this package in their project. Alternatives I am thinking of (which also could be put in addition of providing the feature in this package):
|
Good idea!
There's a really high threshold to add new subcommands to dbt-core, so we probably wouldn't for this. Instead, we're looking for linting of best practices to go into third party tooling. |
I think this falls into the same category as the |
Describe the feature
Warn whenever the
target_schema
ortarget_database
is configured for a dbt snapshot.This is because the best practice in dbt v1.9+ for dbt snapshots is to use
schema
anddatabase
configs rather thantarget_schema
ortarget_database
. See "Additional context" below for more details.Describe alternatives you've considered
Leave things as-is with no warning.
Who will this benefit?
This will benefit folks that want to use the best practices as it relates to configuring dbt snapshots.
Additional context
The feature for
schema
anddatabase
configs on snapshots is in dbt-labs/dbt-core#10301, and this will be released as part of v1.9.dbt-labs/docs.getdbt.com#5805 describes the following changes this introduces for dbt snapshots:
target_schema
is now optional for snapshotstarget_schema
, your snapshot will respectgenerate_schema_name
macrotarget_database
, your snapshot will respectgenerate_schema_name
macrotarget_schema
and/ortarget_database
and that will be where your snapshot is built, but these are "old" configssnapshots
: you can now setdatabase
,schema
,alias
for your snapshots to be used by thegenerate_x_name
macrosThe text was updated successfully, but these errors were encountered: