Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelleArk committed Jan 9, 2023
1 parent 1bb2763 commit 9ed8555
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions core/dbt/events/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ def warn_or_error(event, node=None):
# TODO: resolve this circular import when flags.WARN_ERROR_OPTIONS is WarnErrorOptions type via click CLI.
from dbt.helper_types import WarnErrorOptions

warn_error_options = WarnErrorOptions.from_yaml_string(str(flags.WARN_ERROR_OPTIONS))
if flags.WARN_ERROR or warn_error_options.includes(event.info.name):
warn_error_options = WarnErrorOptions.from_yaml_string(flags.WARN_ERROR_OPTIONS)
if flags.WARN_ERROR or warn_error_options.includes(type(event).__name__):
# TODO: resolve this circular import when at top
from dbt.exceptions import EventCompilationException

Expand Down
7 changes: 3 additions & 4 deletions core/dbt/events/proto_types.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion core/dbt/helper_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,12 @@ def _validate_items(self, items: List[str]):
class WarnErrorOptions(IncludeExclude):
# TODO: this method can be removed once the click CLI is in use
@classmethod
def from_yaml_string(cls, warn_error_options_str: str):
def from_yaml_string(cls, warn_error_options_str: Optional[str]):

# TODO: resolve circular import
from dbt.config.utils import parse_cli_yaml_string

warn_error_options_str = warn_error_options_str or "{}"
warn_error_options = parse_cli_yaml_string(warn_error_options_str, "warn-error-options")
return cls(
include=warn_error_options.get("include", []),
Expand Down

0 comments on commit 9ed8555

Please sign in to comment.