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

dbt init --adapter default to the available adapter #2814

Closed
1 of 5 tasks
jtcohen6 opened this issue Oct 6, 2020 · 2 comments · Fixed by #3483
Closed
1 of 5 tasks

dbt init --adapter default to the available adapter #2814

jtcohen6 opened this issue Oct 6, 2020 · 2 comments · Fixed by #3483
Labels
adapter_plugins Issues relating to third-party adapter plugins bug Something isn't working init Issues related to initializing the dbt starter project
Milestone

Comments

@jtcohen6
Copy link
Contributor

jtcohen6 commented Oct 6, 2020

Describe the bug

In v0.18+, dbt init takes an additional argument --adapter so as to generate profiles.yml according to the adapter type specified.

Steps To Reproduce

Fresh install of a non-core plugin:

pip install dbt-spark

Initialize a project:

$ dbt init my_project
Running with dbt=0.18.0
Creating dbt configuration folder at /Users/jerco/.dbt
With sample profiles.yml for redshift
Encountered an error:
Runtime Error
  Could not find adapter type redshift!

Expected behavior

The --adapter argument should check the adapters available in the context

System information

Which database are you using dbt with?

  • postgres
  • redshift
  • bigquery
  • snowflake
  • other (any community-contrib plugin)

The output of dbt --version:

dbt --version
installed version: 0.18.0
   latest version: 0.18.0

Up to date!

Plugins:
  - spark: 0.18.0
@jtcohen6 jtcohen6 added bug Something isn't working adapter_plugins Issues relating to third-party adapter plugins labels Oct 6, 2020
@jtcohen6 jtcohen6 added the init Issues related to initializing the dbt starter project label Jan 28, 2021
@jtcohen6
Copy link
Contributor Author

jtcohen6 commented May 7, 2021

Another issue: If the adapter plugin doesn't define a sample profiles.yml, dbt doesn't allow the user to run dbt init. Instead, dbt should fall back to a generic one, or do anything smarter than disallowing use of the init command entirely (cc @amychen1776).

@jtcohen6
Copy link
Contributor Author

jtcohen6 commented Jun 6, 2021

Copying from #3434:

If the --adapter argument is not passed, I think our options are:

  • init checks the adapters available, rather than falling back to redshift as the default
  • init falls back to a more reasonable, generic default (not redshift) that ships inside of core

@jtcohen6 jtcohen6 self-assigned this Jun 23, 2021
@jtcohen6 jtcohen6 added this to the Oh-Twenty-One milestone Jun 30, 2021
@jtcohen6 jtcohen6 removed their assignment Nov 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adapter_plugins Issues relating to third-party adapter plugins bug Something isn't working init Issues related to initializing the dbt starter project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant