-
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-377] Configure profiles_dir
with a config file
#4885
Comments
Hi @dbrtly and thanks for the feature request! I'll add this as a backlog ticket and we'll get it prioritized as soon as it makes sense. In the interim, I've generally recommended |
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please remove the stale label or comment on the issue, or it will be closed in 7 days. |
removing stale and clearing assignee, this sounds useful. perhaps we can pick this up for 1.4? |
Sounds a lot like the changes we made to support
This is also related to @dbeatty10's proposed change, to look for
|
:) yes please
Thanks,
Daniel
…________________________________
From: Jeremy Cohen ***@***.***>
Sent: Friday, September 16, 2022 8:27:13 PM
To: dbt-labs/dbt-core ***@***.***>
Cc: Daniel Bartley ***@***.***>; Mention ***@***.***>
Subject: Re: [dbt-labs/dbt-core] [CT-377] dbt_project enhancement (Issue #4885)
Sounds a lot like the changes we made to support target-path and log-path (#5402<#5402>). For consistency with those and other "global"/runtime configs, the precedence order would want to be:
1. CLI flag: --profiles-dir
2. Env var: DBT_PROFILES_DIR
3. Project config: profiles-dir: in dbt_project.yml
This is also related to @dbeatty10<https://github.com/dbeatty10>'s proposed change, to look for profiles.yml in IF a custom --profiles-dir is not set (#5411<#5411>, #5717<#5717>). Taking that into account, the updated precedence order would actually look like:
1. --profiles-dir command-line argument
2. DBT_PROFILES_DIR environment variable
3. profiles-dir property of dbt_project.yml NEW
4. current working directory of dbt_project.yml NEW
5. HOME directory of the user (i.e. ~/.dbt/)
—
Reply to this email directly, view it on GitHub<#4885 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ADLXPTOZIJF4OWF27LDIAEDV6RDQDANCNFSM5Q5NL42Q>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
[CT-377]: https://dbtlabs.atlassian.net/browse/CT-377?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
|
Update: I realized that this might be very tricky because of the order in which dbt parses each config at run initialization. I think dbt needs to read and locate We have been discussing moving |
Agreed that the implementation would be quite involved! Oooh, I like the idea of separating the current
@dbrtly how would you imagine using the proposed Are you aiming to specify the user configuration for the dbt project? Or the database connection configuration? Or both? If you have multiple dbt projects, would you intend to point them all at a single shared If each project would have its own |
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days. |
My initial beef was annoyance at setting $DBT_PROFILES_DIR over and over. These days, I’m also using direnv to run If dbt looked for profiles.yml in the same directory as the dbt_project.yml file, I would be happy with that. If you are going to change this, my perspective is that there should be an option to use a pyproject.toml file for compatibility with the wider modern Python ecosystem. Something like:
Github Actions treats Google project ID as a secret. It never prints it to the logs (always uses a dummy string). I find it a code smell that dbt encourages users to handle the ID with less care. |
Commenting to add my support for using the Like @dbrtly mentioned, the I'm less opinioned on how much stuff to put into Relating this to the precedence order mentioned before, I'd tweak item 3 to the
With the dbt Mesh announcement, I think this will be increasingly more important as people move away from mono-repos (which would probably make item 5 above redundant, since it would now depend on the repo -- at least for project config) This is already supported by things like the SQLFluff package's dbt-templater plugin: [tool.sqlfluff.templater.dbt]
project_dir = <relative or absolute path to dbt_project directory>
profiles_dir = <relative or absolute path to the directory that contains the profiles.yml file>
profile = <dbt profile>
target = <dbt target> |
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days. |
Commenting to keep this alive |
Labeling this as
|
profiles_dir
with a config file
Currently, the parent directory for
@jtcohen6 and I got a chance to discuss this briefly today. We decided a couple things:
So I'm closing this issue as "not planned". |
Is there an existing feature request for this?
Describe the Feature
As per the documentation while this works:
and so does
I would prefer to set it in dbt_project.yml and forget about it.
Describe alternatives you've considered
.env file in repo
Who will this benefit?
cli users
Are you interested in contributing this feature?
yes
Anything else?
No response
The text was updated successfully, but these errors were encountered: