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 and DBT_PROJECT_DIR #3053

Closed
1 task done
jtcohen6 opened this issue Mar 22, 2023 · 2 comments · Fixed by #3177
Closed
1 task done

--project-dir and DBT_PROJECT_DIR #3053

jtcohen6 opened this issue Mar 22, 2023 · 2 comments · Fixed by #3177
Assignees
Labels
content Improvements or additions to content dbt-core v1.5 Docs impact for the v1.5 release (Apr 2023) improvement Use this when an area of the docs needs improvement as it's currently unclear

Comments

@jtcohen6
Copy link
Collaborator

jtcohen6 commented Mar 22, 2023

Contributions

  • I have read the contribution docs, and understand what's expected of me.

Link to the page on docs.getdbt.com requiring updates

I don't think we document --project-dir anywhere!!

We document --profiles-dir in a few places — namely this one — but only in passing.

$ dbt build --help
Usage: dbt build [OPTIONS]

  Run all Seeds, Models, Snapshots, and tests in DAG order

Options:
...
  --profiles-dir PATH             Which directory to look in for the
                                  profiles.yml file. If not set, dbt will look
                                  in the current working directory first, then
                                  HOME/.dbt/
  --project-dir PATH              Which directory to look in for the
                                  dbt_project.yml file. Default is the current
                                  working directory and its parents.
...

What part(s) of the page would you like to see updated?

dbt subcommands have accepted a --project-dir flag since forever.

99% of the time, it makes sense to just run dbt from the same working directory as the dbt project (= where dbt_project.yml lives). This is an advanced feature, often for use in orchestration, that allows dbt commands to be run from a working directory that's different from the one where the dbt project lives.

Starting in v1.5, dbt will now accept an env var DBT_PROJECT_DIR that's equivalent to passing the --project-dir flag. If both are set, the flag wins (takes precedence).

Additional information

@jtcohen6 jtcohen6 added content Improvements or additions to content improvement Use this when an area of the docs needs improvement as it's currently unclear idea Proposes an idea for new content dbt-core v1.5 Docs impact for the v1.5 release (Apr 2023) labels Mar 22, 2023
@matthewshaver
Copy link
Contributor

@jtcohen6 I can build the missing docs for the flags if you can suggest the best spot for them both. I'll take care of the new env var at the same time.

@jtcohen6
Copy link
Collaborator Author

jtcohen6 commented Apr 5, 2023

Let's just mention it on this page: https://docs.getdbt.com/reference/dbt_project.yml

Something to the effect of: "By default, dbt will look in your current working directory for dbt_project.yml, but you can set a different directory using "

@matthewshaver matthewshaver self-assigned this Apr 12, 2023
@dbeatty10 dbeatty10 self-assigned this Apr 12, 2023
@runleonarun runleonarun removed the idea Proposes an idea for new content label Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content Improvements or additions to content dbt-core v1.5 Docs impact for the v1.5 release (Apr 2023) improvement Use this when an area of the docs needs improvement as it's currently unclear
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants