-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[CT-2491] [Bug] Default --target-path
should be relative to --project-dir
, rather than current working directory
#7465
Comments
--target-path
is specified, artifacts are written to the current working directory, rather than the default directory specified in dbt_project.yml--target-path
is specified, artifacts are written to the current working directory, rather than the default directory specified in dbt_project.yml
@OwenKephart Thanks for opening, and for trying out the v1.5 RC! We did need to make some low-level changes to how
Now, the intent was to continue supporting this for the time being (with a deprecation warning: #7185), but it's possible that such functionality isn't supported when you're also running dbt in a separate working directory from I also understand that passing the |
@jtcohen6 Thanks for the quick response! (and oops on missing that bit in the migration guide). The reasoning for removing Setting the Of course, that will all become unnecessary once we port over to the I do still feel like the default behavior here should be to write target files to |
Right on - if you didn't catch this in the docs, it would also be possible to set
This makes sense to me, and it looks like I said the same over in #6882 (comment). I'll keep this issue open accordingly. |
--target-path
is specified, artifacts are written to the current working directory, rather than the default directory specified in dbt_project.yml--target-path
should be relative to --project-dir
, rather than current working directory
Additional context from an internal Slack convo: TL;DR-- |
Per BLG-- Using contexts when changing dirs would make things less error prone |
Upgrading this to a |
I am running into this same issue but with the Note that I was able to solve the issue by replacing I am running |
At least as far as the CLI is concerned, would it be possible to just fix the issue using a callback in the (This however would be a bit of a bandaid and would not fix the underlying problem as far as other interfaces are concerned.) |
We have just encountered the same issue after the upgrade to
I also fully agree relative |
We have just discovered the same issue happens when using |
The fix for this will be in v1.5.2 (next patch) |
Sounds great! Thank you |
When will v1.5.2 be released? |
Is this a new bug in dbt-core?
Current Behavior
Executing a command that targets a project in a specified
--project-dir
results in the json artifacts being written tocurrent-working-directory/target/
rather thanproject-dir/target/
.Expected Behavior
In previous versions, specifying a
target-path
in your dbt_project.yml was relative to the project directory, rather than relative to the current working directory from which the command was executed.Steps To Reproduce
In a new virtual environment (just using duckdb so I don't have to get docker involved):
At this point, you will observe that a new
target
directory has been created insome/other/path
, and no target directory exists in~/jaffle_shop
.Relevant log output
No response
Environment
Which database adapter are you using with dbt?
other (mention it in "Additional Context")
Additional Context
For this example, I'm using the duckdb adapter just for ease of reproducibility, but I don't think that has an impact on this specific behavior.
The text was updated successfully, but these errors were encountered: