Support for dynamic alias names in dbt #529
Description
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
. In dev
the model gets aliased to stage__foo
and in production the alias is just foo
.
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:
The problem is that when I run data-diff --dbt
it uses the dev
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:
> data-diff --dbt
Running with data-diff=0.7.4
dbxyz.stage.stage__foo <> dbxyz.dbt_dev.stage__foo
New model or no access to prod table.
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