-
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
[Feature] Allow dbt init to use profile templates with nested configurations #4462
Comments
Hey @edgarrmondragon, I can't speak for the maintainers, but when I added this in #3625 the only reason for not supporting nested configs was that I didn't know they existed! I don't see any reason not to support it though. This is where the changes will be needed: https://github.com/dbt-labs/dbt-core/blob/main/core/dbt/task/init.py#L123-L160 |
Thanks @NiallRees! I've started a draft PR with I think should be enough for YAML objects to parsed or passed through. Let me know if you think I'm on the right path 😄 |
Would be very interested to see any ideas for this! |
@edgarrmondragon Thanks for opening, and @NiallRees thanks for jumping in with the pointer to the codepath! I also wasn't aware of any profiles that used nested properties, outside of the not-exactly-recommended
Ooh, this does sound neat — in particular, it sounds like we should be using a jsonschema generated from the adapter plugin's For now, I think it's fair to say that these kinds of nested fields are an edge case, and as long as there's some reasonable way to pass their input, it's good enough. |
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. |
Although we are closing this issue as stale, it's not gone forever. Issues can be reopened if there is renewed community interest; add a comment to notify the maintainers. |
Is there an existing feature request for this?
Describe the Feature
Some adapters may have complex profiles with nested objects and arrays, and currently it's not possible to capture user input of such values with
dbt init
andprofile_template.yml
An example of such a profile is what dbt-sqlite requires:
Source
extensions
array will have as many entries as SQLite extensions the user needs.schemas_and_paths
object can have any number of key-value pairs.So, my proposal is to add a new
yaml
type option toprofile_template.yml
prompts and use that to parse input as YAML that is written as such to the profiles file.Describe alternatives you've considered
Make arrays and objects
fixed
in theprofile_template.yml
file. This makes the user edit the~/.dbt/profiles.yml
instead of relying solely on input.A different (and harder to implement) spec where object and array prompts are walked recursively based on something like a JSON schema for the profile.
Who will this benefit?
Users of
dbt-sqlite
(or any adapter with such configuration requirements) initializing new dbt projects.Are you interested in contributing this feature?
Yes!
Anything else?
If you're interested, I can start a PR soon 😄
The text was updated successfully, but these errors were encountered: