Skip to content

Commit

Permalink
Add _fixed key config back for _choice options in profile_template.yml (
Browse files Browse the repository at this point in the history
  • Loading branch information
NiallRees authored Oct 22, 2021
1 parent 02fdc2c commit 420ef9c
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions core/dbt/task/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,17 +137,21 @@ def generate_target_from_input(
profile_template_local[key][choice], target
)
else:
hide_input = value.get("hide_input", False)
default = value.get("default", None)
hint = value.get("hint", None)
type = click_type_mapping[value.get("type", None)]
text = key + (f" ({hint})" if hint else "")
target[key] = click.prompt(
text,
default=default,
hide_input=hide_input,
type=type
)
if key.startswith("_fixed"):
# _fixed prefixed keys are not presented to the user
target[key[7:]] = value
else:
hide_input = value.get("hide_input", False)
default = value.get("default", None)
hint = value.get("hint", None)
type = click_type_mapping[value.get("type", None)]
text = key + (f" ({hint})" if hint else "")
target[key] = click.prompt(
text,
default=default,
hide_input=hide_input,
type=type
)
return target

def get_profile_name_from_current_project(self) -> str:
Expand Down Expand Up @@ -205,7 +209,7 @@ def create_profile_from_target(self, adapter: str, profile_name: str):
profiles_filepath = Path(flags.PROFILES_DIR) / Path("profiles.yml")
logger.info(
f"Profile {profile_name} written to {profiles_filepath} using target's "
" profile_template.yml and your supplied values. Run 'dbt debug' to "
"profile_template.yml and your supplied values. Run 'dbt debug' to "
"validate the connection."
)
else:
Expand Down

0 comments on commit 420ef9c

Please sign in to comment.