Skip to main content


Transformations: Allow customization to the generated profiles.yml for Dbt


Please sign in to leave a comment.



  • Official comment
    Alexander User

    Would you please tell me more about what you are trying to accomplish? I'm open to the idea of making the yml customizable. I'm keen to understand your goal in doing so to help us understand the value of offering customization here.

    In the same snowflake account I am having multiple database for dev, QA and prod. I am selecting the database/schema to be used for reading source table or creating model/snapshot on basis of jinja template which looks something like this :-

    {%- if == "dev" -%} ODS_POC
    {%- elif == "qa" -%} ODS_QA
    # For testing in Fivetran reverting to ODS_POC
    {%- elif == "prod" -%} ODS_POC
    {%- else -%} invalid_database
    {%- endif -%}

    I am able to set as dev by running 

    dbt run --target dev

    but since the profiles.yml has only prod as, this fails. For the time being I am trying to fix this 

    We have Sandeep's use case mentioned previously, as well as another one.

    We would like to use different roles to run different models. When we use dbt to create different views/tables, we want to customize the owner of those. For more sensitive data we want more locked down roles to create them, and vice-versa. There are other work-arounds we can use but being able to use roles would be the cleanest.

    To add to this, we would like to select the _warehouse_ in Snowflake; potentially addressable by specifying a Role for transformations, and setting the default warehouse for that Role (there's a FR in progress for this, I think?), or through a custom profiles.yml (as in this discussion).

  • Alexander User

    Awesome discussion, thank you for the explanations! I expect our first version of this to be targeted specifically at managing test and production environments. We will look at allowing further customizations to the yml, too. It's a balance against ease of use.

    Using different roles to run different models is further down the road. I see the utility. For now, I took the liberty of creating a separate feature request so Chris' request doesn't get lost in the comments of this one. Here is that idea - be sure to upvote!

    There is also this related idea:

    I see that this feature is now being supported

    Thanks for the quick turn around