-
Notifications
You must be signed in to change notification settings - Fork 280
Support for dynamic alias names in dbt #529
Comments
+1 for this |
Hi @btello, there is support for dynamic model names now via the https://docs.datafold.com/development_testing/open_source#configure-your-dbt-project |
@dlawin Thanks for the reply! After testing Is there a way that I can compare the same model across
|
It seems using model.alias in both manifests is not always accurate, we should use relation_name instead, that seems to be the true representation of the model's deployed name |
Hey @btello @followingell this should be resolved in versions >=0.8.0 via use of the Duplicate issue: #646 Can you reopen this issue if there are any remaining problems? |
@dlawin Finally got around to testing this and it's working great, thank you! |
Is your feature request related to a problem? Please describe.
In our environment, we leverage dynamic alias names using dbt's
generate_alias_name
macro:https://docs.getdbt.com/docs/build/custom-aliases#generate_alias_name
For example, let's say we have a model named
foo
. Indev
the model gets aliased tostage__foo
and in production the alias is justfoo
.A good breakdown of why we implemented things this way as well as the actual code we're using in
generate_alias_name
can be found on this blog post:https://medium.com/data-manypets/how-to-customise-dbts-model-naming-for-easy-developing-on-production-1238559a939a
The problem is that when I run
data-diff --dbt
it uses thedev
version of the alias for both the dev and prod targets and ultimately this means I can't use data-diff in my environment (which I very much want to do :-) ).Example:
Describe the solution you'd like
I would like to be able to use data-diff in an environment where I have customized dynamic alias names as described above.
Describe alternatives you've considered
I could add a static custom alias to each of my models but I've got several hundred models and this solution would just be very error prone.
Additional context
None
The text was updated successfully, but these errors were encountered: