Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix error message for empty/None: --warn-error-options handling
  • Loading branch information
MichelleArk committed May 30, 2023
commit ab4b571654531ef0ff1afc2da24b94fc3cbf8194
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixes-20230530-104228.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: Fix empty --warn-error-options error message
time: 2023-05-30T10:42:28.382804-04:00
custom:
Author: michelleark
Issue: "7730"
5 changes: 3 additions & 2 deletions core/dbt/cli/option_types.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from click import ParamType, Choice

from dbt.config.utils import parse_cli_vars
from dbt.config.utils import parse_cli_yaml_string
from dbt.exceptions import ValidationError

from dbt.helper_types import WarnErrorOptions
Expand All @@ -16,7 +16,8 @@ def convert(self, value, param, ctx):
if not isinstance(value, str):
self.fail(f"Cannot load YAML from type {type(value)}", param, ctx)
try:
return parse_cli_vars(value)
param_option_name = param.opts[0] if param.opts else param.name
return parse_cli_yaml_string(value, param_option_name.strip("-"))
except ValidationError:
self.fail(f"String '{value}' is not valid YAML", param, ctx)

Expand Down