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 with relative paths? #2541

Closed
max-sixty opened this issue Jun 12, 2020 · 2 comments
Closed

--project-dir with relative paths? #2541

max-sixty opened this issue Jun 12, 2020 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@max-sixty
Copy link
Contributor

Describe the bug

--project-dir doesn't use relative paths, and I got confused given the error message

Steps To Reproduce

Run a project in a child path; say we have a DBT project in a path called sql under the current one:

$ dbt run --project-dir sql
Running with dbt=0.17.0
Encountered an error while reading the project:
  ERROR: Runtime Error
  no dbt_project.yml found at expected path sql/dbt_project.yml
Encountered an error:
Runtime Error
  Could not run dbt

$ dbt run --project-dir (pwd)/sql
Running with dbt=0.17.0
Found 4 models, 0 tests, 0 snapshots, 0 analyses, 147 macros, 0 operations, 0 seed files, 0 sources

I was doubting my sanity for a second with no dbt_project.yml found at expected path sql/dbt_project.yml

Expected behavior

Use relative paths, or if this is deliberate, don't accept relative paths

The output of dbt --version:

installed version: 0.17.0
   latest version: 0.17.0

Up to date!

Plugins:
  - bigquery: 0.17.0
  - snowflake: 0.17.0
  - redshift: 0.17.0
  - postgres: 0.17.0

The operating system you're using:
MacOS

The output of python --version:
Python 3.7.7

@max-sixty max-sixty added bug Something isn't working triage labels Jun 12, 2020
@drewbanin drewbanin added enhancement New feature or request and removed bug Something isn't working triage labels Jun 12, 2020
@drewbanin
Copy link
Contributor

hey @max-sixty - this tripped me up too! See here: #2534 (comment)

Let's definitely make relative paths work for --project-dir at some point in the future. This is a pretty tricky part of the codebase - dbt does lots of magic to support running dbt run from a subdir of a dbt project (eg. models/), so it might be a little involved to get this working well. I do think it's worth doing though!

@drewbanin drewbanin added this to the 0.17.1 milestone Jun 15, 2020
@beckjake
Copy link
Contributor

Fixed in #2534

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants