-
Notifications
You must be signed in to change notification settings - Fork 288
Use the same logic as dbt-core for the path for the project and profiles #415
Use the same logic as dbt-core for the path for the project and profiles #415
Conversation
@erezsh I made an attempt to update the mocks so that they are If someone is willing to re-run the CI workflows, we can see if that worked or not. |
I'm getting this error, so I'll just need to look at the way the test is expressed and update the test accordingly:
Alternatively, I could cast all the |
yeah I should have used |
This is dbt's behavior only as of >=1.4 correct? Just worried we cause a disconnect for dbt < 1.4 |
I think we should make this change and align with dbt, but I do think we should also consider how to handle <1.4 The shift of this default location was a little jarring for dbt users, and anecdotally I've seen many work around the change via the environment variable If we had a The location of this file is a little chaotic at the moment, and the <dbt_project>/profiles.yml file will often have |
Agreed that it makes sense to align with the behavior based on the dbt version. I just pushed some changes to try handling both the Behavior for dbt >= 1.3The parent directory for profiles.yml is determined using the following precedence:
Behavior prior to 1.3:The parent directory for profiles.yml is determined using the following precedence:
Both are documented here. The version needs to be changed at the top of the screen to switch between versions. |
…ty10/data-diff into dbeatty10/dbt-profiles-dbt-project
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great, really appreciate the contributions Doug!
Like the wording update @dlawin -- thanks for putting that in there 🏅 |
Thanks, @dbeatty10! |
resolves #416
Overview
The changes in this PR allow using the same logic as dbt. The precedence for the location of
profiles.yml
changed starting dbt-core>=1.4.0.This PR is designed to determine the version of dbt indicated within the manifest and use the applicable logic.
Behavior for dbt >= 1.3
The parent directory for profiles.yml is determined using the following precedence:
--profiles-dir
option (--dbt-profiles-dir
indata-diff
)DBT_PROFILES_DIR
environment variable~/.dbt/
directoryBehavior prior to 1.3:
The parent directory for profiles.yml is determined using the following precedence:
--profiles-dir
option (--dbt-profiles-dir
indata-diff
)DBT_PROFILES_DIR
environment variable~/.dbt/
directoryBoth are documented here. The version needs to be changed at the top of the screen to switch between versions.
Implementation details
Path
is used liberally.Source of the logic
The relevant logic is located here in
dbt-core
: