-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[Feature] Take --target-path
/ DBT_TARGET_PATH
into account for dbt clean
#11346
Comments
dbt clean
doesn't take into account --target-path
Thanks for reaching out @iwarp ! I see what you are saying: This behavior aligns with the description of
I can see why you'd want it to include Since the current behavior matches our documentation, I'm going to convert this to a feature request for further consideration. In the meantime, here are a couple workarounds: Workaround for
|
dbt clean
doesn't take into account --target-path
--target-path
/ DBT_TARGET_PATH
into account for dbt clean
@iwarp I took a closer look at this. The relevant code is here: dbt-core/core/dbt/config/project.py Lines 414 to 420 in 94b6ae1
Basically, if you have ExampleHere's an example after I made sure to not include
SummaryThe precedence order is essentially this:
We could theoretically switch the precedence order so that it is something like this:
But we'd need to further consider the pros/cons of such a change. |
Is this a new bug in dbt-core?
Current Behavior
I'm planning to use different target directories for performance reasons when running in a container, using different target-dirs for dev, test, prod to cache the generation of the manifest.json.
When running dbt clean with a target-path this is ignored and only looks at the target folder.
Expected Behavior
Expect that it should clean the files in my provided target-path parameter.
Steps To Reproduce
Running the following command is correct and generates a target-dev folder
dbt parse --profiles-dir=../.dbt --target=dev -d --target-path=target-dev
When i run dbt clean it does not clean up the files in my target-dev but cleans up files in the target folder not target-dev.
dbt clean --profiles-dir=../.dbt --target=dev -d --target-path=target-dev
Relevant log output
Environment
Which database adapter are you using with dbt?
bigquery
Additional Context
Related to PR #5402
The text was updated successfully, but these errors were encountered: