You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the existing issues, and I could not find an existing issue for this feature
I am requesting a straightforward extension of existing dbt functionality, rather than a Big Idea better suited to a discussion
Describe the feature
Historically, snapshots require you set set an explicit target_schema and target_database - meaning by default, regardless of what environment you're in (dev, ci, prod, etc.), when you run dbt snapshot it will build to the same table.
This can be problematic when trying to test out changes to existing snapshot or develop a new snapshot. Now that we have deferral and dbt clone, it no longer makes sense that snapshots wouldn't respect generate_schema_name / generate_database_name like other resources (models, seeds, etc.).
We need to consider backwards compatibility for this change.
Acceptance criteria
we makes these old configs optional and if you don't set a target_schema or target_database, we default to using the generate_x_name macros
add configs schema and database to be consistent with other resource types (inputs to the generate_x_name macros)
continue to accept old names as the "hard-coded" / current experience
Describe alternatives you've considered
Our pal @dbeatty10 often configured his snapshots as so:
@jtcohen6 do you happen to know why snapshots were originally built with this explicit required override for target_schema? Was this implemented before deferral existed?
@QMalcolm this feels like something we should have some tests to capture. And for future features, should we consider adding some guidelines of adding new features(like creating some kind of tests)?
Is this your first time submitting a feature request?
Describe the feature
Historically, snapshots require you set set an explicit
target_schema
andtarget_database
- meaning by default, regardless of what environment you're in (dev, ci, prod, etc.), when you rundbt snapshot
it will build to the same table.This can be problematic when trying to test out changes to existing snapshot or develop a new snapshot. Now that we have
deferral
anddbt clone
, it no longer makes sense that snapshots wouldn't respectgenerate_schema_name
/generate_database_name
like other resources (models, seeds, etc.).We need to consider backwards compatibility for this change.
Acceptance criteria
target_schema
ortarget_database
, we default to using thegenerate_x_name
macrosschema
anddatabase
to be consistent with other resource types (inputs to thegenerate_x_name
macros)Describe alternatives you've considered
Our pal @dbeatty10 often configured his snapshots as so:
Our pal @jeremyyeo often does:
Relevant docs / discussions
target_schema
for snapshots?From the snapshots github discussion:
The text was updated successfully, but these errors were encountered: