Closed dbeatty10 closed 4 years ago
This is great! I had no idea about the sample_profiles.yml
file.
The spark adapter and others use bracket placeholder strings in its file: https://github.com/fishtown-analytics/dbt-spark/blob/master/dbt/include/spark/sample_profiles.yml
I am thinking we should follow the same convention. Plus, while it's convenient to have the verbose comments in that file, it duplicates what's in the README so edits would have to happen in both places. I've rather the README be the single place for documentation, and the sample_profiles.yml
stay bare.
Could you make these changes to this branch?
This is great! I had no idea about the
sample_profiles.yml
file.The spark adapter and others use bracket placeholder strings in its file: https://github.com/fishtown-analytics/dbt-spark/blob/master/dbt/include/spark/sample_profiles.yml
I am thinking we should follow the same convention. Plus, while it's convenient to have the verbose comments in that file, it duplicates what's in the README so edits would have to happen in both places. I've rather the README be the single place for documentation, and the
sample_profiles.yml
stay bare.Could you make these changes to this branch?
Thanks for the great feedback. I made the following updates:
Overview
Starting in dbt v0.18.0, the
dbt init
allows an optional--adapter
. If you do, dbt will create~/.dbt/profiles.yml
(if one does not already exist) in accordance with the intended adapter type.The dbt documentation includes a note for plugin authors that the
--adapter
flag looks for a file nameddbt/include/[adapter_name]/sample_profiles.yml
. The provided examples are dbt-spark and dbt-presto.This pull request adds that file.
Testing
2 cases were tested:
~/.dbt/profiles.yml
does not already exist~/.dbt/profiles.yml
already existsIn the former case, a new
~/.dbt/profiles.yml
file is created, and it contains the template fromdbt/include/sqlite/sample_profiles.yml
.In the latter case, the
sample_profiles.yml
file is ignored and it is completely up to the user to add the relevant configuration (as directed in theREADME
).