Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dbt sometimes writes a .user.yml and ignores configs #1645

Closed
beckjake opened this issue Jul 30, 2019 · 1 comment · Fixed by #1656
Closed

dbt sometimes writes a .user.yml and ignores configs #1645

beckjake opened this issue Jul 30, 2019 · 1 comment · Fixed by #1656
Labels
bug Something isn't working
Milestone

Comments

@beckjake
Copy link
Contributor

Issue

If you pass dbt a relative path to --profiles-dir or the DBT_PROFILES_DIR environment variable and execute from a subdirectory, dbt will look for the user cookie and profiles.yml in different places (the latter correct, the former incorrect).

Results

What happened? What did you expect to happen?
I got a ./profiles/.user.yml and my settings were ignored. I expected my settings to be respected or to receive an error, and to not have a new file.

Suggested fixes:
My preference: don't allow users to run dbt from subdirectories.
Other option: defer loading of the user config until after we've found dbt_project.yml.

System information

The output of dbt --version:

0.14.0

The operating system you're running on:
Any

The python version you're using (probably the output of python --version)
Any

Steps to reproduce

In as much detail as possible, please provide steps to reproduce the issue. Sample data that triggers the issue, example models, etc are all very helpful here.

  1. Make a dbt project in ${project_root}
  2. put your profiles.yml in ${project_root}/profiles
  3. Make a subdirectory (${project_root}/models) and cd into it
  4. Run dbt with the relative path to the profiles directory as an argument to --profiles-dir: dbt run --profiles-dir profiles
  5. You will now have a ${project_root}/models/profiles/.user.yml with cookie information. Also, any settings in your profiles.yml won't be respected.
@drewbanin drewbanin added this to the 0.14.1 milestone Jul 30, 2019
@drewbanin drewbanin added the bug Something isn't working label Jul 30, 2019
@drewbanin
Copy link
Contributor

Let's definitely preserve the behavior where you can execute dbt from subdirs of the project. Let's instead pursue this approach:

defer loading of the user config until after we've found dbt_project.yml

drewbanin added a commit that referenced this issue Aug 4, 2019
iknox-fa pushed a commit that referenced this issue Feb 8, 2022
automatic commit by git-black, original commits:
  57c6b11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants