Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.
This repository was archived by the owner on May 17, 2024. It is now read-only.

Support for dynamic alias names in dbt #529

Closed
@btello

Description

@btello

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:

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 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

Metadata

Metadata

Assignees

Labels

--dbtIssues/features related to the dbt integrationenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions