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

v0.16.1: dbt deps doesn't respect "--project-dir" flag #2338

Closed
2 of 5 tasks
nickwu241 opened this issue Apr 17, 2020 · 0 comments · Fixed by #2339
Closed
2 of 5 tasks

v0.16.1: dbt deps doesn't respect "--project-dir" flag #2338

nickwu241 opened this issue Apr 17, 2020 · 0 comments · Fixed by #2339
Labels
bug Something isn't working

Comments

@nickwu241
Copy link
Contributor

nickwu241 commented Apr 17, 2020

I've attempted to fix the bug at #2339

Describe the bug

Upgrading from version v0.16.0 to v0.16.1 breaks running dbt deps --project-dir project when the dbt deps --project-dir command is run from outside the project directory.

--project-dir flag is not respected anymore.

Steps To Reproduce

On v0.16.1 this will fail

  1. cd .. from a dbt project directory

  2. dbt deps --project-dir project will fail

Example directory structure: https://github.com/nickwu241/dbt-bug
Example Logs of working in v0.16.0 but not v0.16.1:

~/dbt-bug/project                                                                                 env
❯ cd ..
~/dbt-bug                                                                                         env
❯ dbt deps --project-dir project
Running with dbt=0.16.0
Installing https://github.com/fishtown-analytics/dbt-utils.git@0.1.21
  Installed from revision 0.1.21

~/dbt-bug                                                                                     5s  env
❯ dbt deps --project-dir project
Running with dbt=0.16.1
Encountered an error while reading the project:
  ERROR: Runtime Error
  no dbt_project.yml found at expected path /Users/nickwu/dbt-bug/dbt_project.yml
Encountered an error:
Runtime Error
  Could not run dbt

With --debug:

❯ dbt --debug deps --project-dir project
2020-04-17 09:16:55.283620 (MainThread): Running with dbt=0.16.1
2020-04-17 09:16:55.283825 (MainThread): Encountered an error while reading the project:
2020-04-17 09:16:55.283966 (MainThread):   ERROR: Runtime Error
  no dbt_project.yml found at expected path /Users/nickwu/dbt-bug/dbt_project.yml
2020-04-17 09:16:55.289265 (MainThread): Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'invalid', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x10b4248d0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x10b440690>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x10b440cd0>]}
2020-04-17 09:16:55.289927 (MainThread): Encountered an error:
2020-04-17 09:16:55.290013 (MainThread): Runtime Error
  Could not run dbt
2020-04-17 09:16:55.290995 (MainThread): Traceback (most recent call last):
  File "/Users/nickwu/src/github.com/nickwu241/dbt/core/dbt/task/base.py", line 59, in from_args
    config = cls.ConfigType.from_args(args)
  File "/Users/nickwu/src/github.com/nickwu241/dbt/core/dbt/config/runtime.py", line 310, in from_args
    partial = Project.partial_load(os.getcwd())
  File "/Users/nickwu/src/github.com/nickwu241/dbt/core/dbt/config/project.py", line 508, in partial_load
    project_dict = _raw_project_from(project_root)
  File "/Users/nickwu/src/github.com/nickwu241/dbt/core/dbt/config/project.py", line 193, in _raw_project_from
    .format(project_yaml_filepath)
dbt.exceptions.DbtProjectError: Runtime Error
  no dbt_project.yml found at expected path /Users/nickwu/dbt-bug/dbt_project.yml

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/nickwu/src/github.com/nickwu241/dbt/core/dbt/main.py", line 81, in main
    results, succeeded = handle_and_check(args)
  File "/Users/nickwu/src/github.com/nickwu241/dbt/core/dbt/main.py", line 159, in handle_and_check
    task, res = run_from_args(parsed)
  File "/Users/nickwu/src/github.com/nickwu241/dbt/core/dbt/main.py", line 198, in run_from_args
    task = parsed.cls.from_args(args=parsed)
  File "/Users/nickwu/src/github.com/nickwu241/dbt/core/dbt/task/base.py", line 67, in from_args
    raise dbt.exceptions.RuntimeException('Could not run dbt') from exc
dbt.exceptions.RuntimeException: Runtime Error
  Could not run dbt

Expected behavior

dbt deps --project-dir project should install packages for my dbt project at project directory.

Screenshots and log output

Please see Steps to Reproduce.

System information

Which database are you using dbt with?

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

The output of dbt --version:

installed version: 0.16.1
   latest version: 0.16.1

Up to date!

The operating system you're using: macOS

The output of python --version: Python 3.7.5

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