(#1645) fix for errant cookie generation #1656
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes #1645
This PR fixes an issue where dbt generated a
profiles/.user.yml
file if the--profiles-dir
flag (or$DBT_PROFILES_DIR
env var) was set to a path which did not contain a profiles.yml file. There remains an inconsistency between how--profiles-dir
and$DBT_PROFILES_DIR
operate when users run dbt from a subdirectory of the project. We should resolve this issue in a future PR, potentially by deferring the loading of the user config until dbt understands more of the project structure. See #1645 for more information on this approach.Ultimately, if a user points dbt to a profile dir which does not contain a profile, dbt is going to fail pretty hard. This PR fixes a symptom of that problem -- dbt will no longer create user cookies in directories which are not already identified by
profiles.yml
files. Note: this means that the user cookie id may be inconsistent for the first couple of runs for a user, or between runs when the profile dir is being changed dynamically with--profiles-dir
or$DBT_PROFILES_DIR
. I am happy to trade a little bit of noise in the anonymous event data to prevent these cookies from being errantly littered across the users' filesystems.