-
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-1418] [Bug] CLI argument --profile
ignored in dbt init
#6154
Comments
--profile
ignored in dbt init
--profile
ignored in dbt init
hi @scheah92, thanks for reporting, I am able to reproduce this. my first thought was the order of arguments, so perhaps we are reworking our CLI commands as part of v1.4 and v1.5 and we can likely pick this up for those releases |
Hi @lostmygithubaccount, if you guys are reworking CLI commands, you might be interested to know that |
Good place to start looking at this: dbt-core/core/dbt/task/init.py Line 247 in edb5634
|
The code shows that the profile argument is simply ignored: |
Would it be possible, if I pick this up ?
I am a first time contributor to the dbt-core repo. |
I submitted a PR for it: #7450 |
Cool, thanks! |
Is this a new bug in dbt-core?
Current Behavior
According to
dbt init --help
, the--profile
option lets the user load an existing profile to use with a new project. However, that option currently does nothing when you call it withdbt init
.Example:
Result:
proj1 created with
proj1/dbt_project.yml
showingprofile: 'proj1'
.~/.dbt/profiles.yml
shows a new profileproj1
created with placeholders. Note: if a profile namedproj1
already exists, dbt still creates another profile namedproj1
again.In contrast, calling
dbt run --profile default
actually does make the project use the profiledefault
, so the--profile
argument does work elsewhere at least.Expected Behavior
proj1 created with
proj1/dbt_project.yml
showingprofile: 'default'
.~/.dbt/profiles.yml
should not show any new profile created.Steps To Reproduce
~/.dbt/profiles.yml
and create a new profiledefault
.dbt init --profile default proj1
cd
into/proj1
and opendbt_project.yml
. Theprofile
will be set toproj1
instead ofdefault
.~/.dbt/profiles.yml
again and see that dbt has created a new blankproj1
profile to go with the new project, instead of using the existingdefault
profile.Relevant log output
No response
Environment
Which database adapter are you using with dbt?
postgres
Additional Context
No response
The text was updated successfully, but these errors were encountered: