-
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-569] [Feature] Allow profile_template to prompt and name a target
#5179
Comments
target
target
@alexrosenfeld10 Right on! I think this would be a self-contained change, and probably a simple one: dbt-core/core/dbt/task/init.py Lines 187 to 189 in f633e99
It might look like inspecting the output of Is this something you might be interested in contributing? There's just one tricky piece of this, which will be writing an automated test. We need to refactor and convert the tests for |
@jtcohen6 Sure, happy to contribute. I agree, that's definitely an easy way to solve this, however it does allow for a user to set syntactically invalid targets in their init flow. Is that something we want to care about here? In thinking about this I noticed that the profile template also allows other silly things, such as: prompts:
threads:
type: string
i_am_not_a_real_thing:
type: string
hint: blargh
user:
type: bool
hint: your snowflake username... which probably isn't a bool If we want, it'd be pretty easy to add some simple "am I valid yaml" regexing to the input target. Entirely possible we just don't care / I'm overthinking this. Here's a PR #5184 with the naive approach coded out |
Relevant docs update here: dbt-labs/docs.getdbt.com#1388 wasn't sure what to do about the versioning, just going to leave it at that for now and open an issue for the docs side of things |
@alexrosenfeld10 Appreciate the thought you've given this! The folks creating
So, definitely not most users, and definitely people with some prior dbt experience. I think the naive solution is probably okay for now. But we could definitely do more here to help over the long run. I'm also thinking about the fact that a lot of the information in |
I agree that's the folks creating the template.. but folks inputting options in response to |
@jtcohen6 I think this is worth merging, but upon further thought it is kind of a mediocre way to cover my use case. Expanding on this a bit more - is there any reason dbt doesn't allow arbitrary properties to be set in the profile? I'm after a turn-key experience where
Ideally, I'd love to do something like this: my_project:
outputs:
local_arosenfeld:
account: my.account
...
snowflake_env: qa
snowflake_schema: alex_dev The resulting database and schema for such a configuration would yield The only way I found to do such a thing is by using Because I can't set custom properties, I'm using the target name. However, that's far from ideal, especially when you need to work in two pieces of metadata (I'm getting around that with a double underscore + |
The more I think about it the more I realize that env vars are just better for this. That just means I need an extra step for folks to get set up running locally. Not the end of the world, but as someone buildin dbt project setups for many upstream teams to consume, all of which are novices in the dbt space, it'd be nice to have |
resolves #1389 [Preview](https://deploy-preview-3706--docs-getdbt-com.netlify.app/reference/commands/init?version=1.2) ## What are you changing in this pull request and why? dbt-labs/dbt-core#5179 added `target`, and this was released in v1.2. This PR adds docs for this feature using the appropriate versioning. ## 🎩 ### v1.1 https://deploy-preview-3706--docs-getdbt-com.netlify.app/reference/commands/init?version=1.1 <img width="600" alt="image" src="https://github.com/dbt-labs/docs.getdbt.com/assets/44704949/4c5b48fc-e15e-4efe-bda6-1356986eb679"> ### v1.2 https://deploy-preview-3706--docs-getdbt-com.netlify.app/reference/commands/init?version=1.2 <img width="600" alt="image" src="https://github.com/dbt-labs/docs.getdbt.com/assets/44704949/f98d495b-8d32-47a8-b271-052b41f9cbfa"> ## Checklist - [x] Review the [Content style guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md) and [About versioning](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#adding-a-new-version) so my content adheres to these guidelines.
Is this your first time opening an issue?
Describe the Feature
I'm not 100% sure if this is or isn't yet an option, but I didn't find it anywhere online in searching.
It'd be nice if
profile_template.yml
allowed to set thetarget
name, like so:or,
Describe alternatives you've considered
No response
Who will this benefit?
No response
Are you interested in contributing this feature?
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: