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

Project dir argument not used when running debug #1733

Closed
1 of 5 tasks
gobbledygook88 opened this issue Sep 10, 2019 · 2 comments
Closed
1 of 5 tasks

Project dir argument not used when running debug #1733

gobbledygook88 opened this issue Sep 10, 2019 · 2 comments
Labels
bug Something isn't working

Comments

@gobbledygook88
Copy link

gobbledygook88 commented Sep 10, 2019

Describe the bug

When running dbt debug --project-dir=<some directory> in another directory to that of your dbt project, the dbt_project.yml is not used.

Steps To Reproduce

With an existing dbt project:

$ cd /tmp
$ dbt debug --project-dir=<path/to/project> --profiles-dir=$HOME/.dbt/

we get the following output:

Using profiles.yml file at /app/src/pipeline/profiles.yml

Configuration:
  profiles.yml file [OK found and valid]
  dbt_project.yml file [ERROR not found]
  profile: some-profile-name [OK found]
  target: production [OK found]

Expected behavior

Would expect the output to be the following:

Using profiles.yml file at /app/src/pipeline/profiles.yml

Configuration:
  profiles.yml file [OK found and valid]
  dbt_project.yml file [OK found and valid]
  profile: some-profile-name [OK found]
  target: production [OK found]

System information

Which database are you using dbt with?

  • postgres
  • redshift
  • bigquery
  • snowflake
  • other (specify: ____________)

The output of dbt --version:

installed version: 0.14.0
   latest version: 0.14.1

Also tried with version 0.14.1. and obtained the same behavior.

The operating system you're using:
Ubuntu 19.04

The output of python --version:
Python 3.7.4

Additional context

After a brief debugging session, we found the get_nearest_project_dir() function in dbt/core/dbt/task/base.py. This function is called when running dbt compile and dbt run, but not dbt debug.

Inspecting the parsed arguments shows the project_dir attribute is set correctly.

When running dbt debug in the actual project directory, dbt is able to pick up dbt_project.yml correctly.

@gobbledygook88 gobbledygook88 added bug Something isn't working triage labels Sep 10, 2019
@drewbanin drewbanin removed the triage label Sep 10, 2019
@drewbanin
Copy link
Contributor

Thanks for the report @gobbledygook88! Your diagnosis sounds spot-on to me

franloza pushed a commit to franloza/dbt that referenced this issue Dec 8, 2019
@drewbanin drewbanin added this to the Barbara Gittings milestone Jan 7, 2020
beckjake added a commit that referenced this issue Jan 10, 2020
Fix project dir argument when running debug (#1733)
@beckjake
Copy link
Contributor

Fixed in #1989

iknox-fa pushed a commit that referenced this issue Feb 8, 2022
automatic commit by git-black, original commits:
  c1b3690
sevkw added a commit to sevkw/docs.getdbt.com that referenced this issue Feb 17, 2022
the dbt debug command was quite outdated, and after researching this issue  dbt-labs/dbt-core#1733
I found the correct dbt debug should be dbt debug --project-dir=<path/to/project>
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

No branches or pull requests

3 participants