question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

With `dbt run` the `--profiles-dir` becomes relative to `--project-dir`

See original GitHub issue

Describe the bug

The --profiles-dir flag becomes relative to the --project-dir flag when running dbt run. It does not for dbt debug.

Steps To Reproduce

Let’s say we have the profiles.yml in the current working directory and our dbt project in a sub-directory jaffle-shop. Then the following command runs without a problem (if all is set-up correctly):

dbt debug --project-dir jaffle-shop/ --profiles-dir .

However, with dbt run this does not work.

dbt run --project-dir jaffle-shop/ --profiles-dir .     # can not find profile

This is because for dbt run the profiles directory argument becomes relative to the project directory. Ergo, the following does work:

dbt run --project-dir jaffle-shop/ --profiles-dir ..     # works unexpectedly

Expected behavior

The --profile-dir flag should behave the same for all dbt commands.

Screenshots and log output

N/A

System information

N/A/

The output of dbt --version:

installed version: 0.19.0
   latest version: 0.19.0

Up to date!

Plugins:
  - bigquery: 0.19.0
  - snowflake: 0.19.0
  - redshift: 0.19.0
  - postgres: 0.19.0
  - sqlserver: 0.19.0.1

The operating system you’re using:

ProductName:    macOS
ProductVersion: 11.2.1
BuildVersion:   20D75

The output of python --version:

Python 3.7.2

Additional context

Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
JCZuurmondcommented, Mar 10, 2021

Hi @jtcohen6, just want to mention that I am having a go at this. However, it takes some time to get the environment set-up right before I can start running the tests, soooo it is work in progress 🚧

1reaction
JCZuurmondcommented, Mar 17, 2021

Hi @jtcohen6, thanks for your response. I was just able to run the tests with the Docker image ✨!

The issue was completely on my side. Docker was quite messed up, e.g. the ubuntu:14.04 image worked but 16.04, 18.04 and 20.04 did not. Also some of the apt-get packages installed well and others did not.

Apparently Apple’s Screen Time app was blocking some content 😅, therefore some - not all - Ubuntu registries. After disabling that and struggling some more, I was finally able to run the tests after a reboot of my computer.

Read more comments on GitHub >

github_iconTop Results From Across the Web

With `dbt run` the `--profiles-dir` becomes relative to `--project ...
Describe the bug The --profiles-dir flag becomes relative to the --project-dir flag when running dbt run. It does not for dbt debug.
Read more >
Connection profiles - dbt Developer Hub
Configure your profile using the command line.
Read more >
How to set location of profiles.yml and dbt_project.yml files in ...
The command you'll want to run is: dbt run --project-dir /path/to/new/dbt_project.yml_file --profiles-dir /path/to/new/profiles.yml_file.
Read more >
Data Diffs with Meltano and dbt-osmosis
We need dbt to parse, compile, and run a query that uses the compiled SQL from both of these revisions. A simple execution...
Read more >
dbt (dagster-dbt)
Sends a request with the method run to the dbt RPC server, and returns the response. For more details, see the dbt docs...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found