From 61bc0176fe1168b57a744c834bf99a6b4b9b1c60 Mon Sep 17 00:00:00 2001 From: Emily Rockman Date: Thu, 12 Jan 2023 11:25:47 -0600 Subject: [PATCH 1/2] finish message rename in types.proto --- core/dbt/events/proto_types.py | 6 ++++-- core/dbt/events/types.proto | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/core/dbt/events/proto_types.py b/core/dbt/events/proto_types.py index 2fc6ad1ccd7..74858b828e9 100644 --- a/core/dbt/events/proto_types.py +++ b/core/dbt/events/proto_types.py @@ -47,7 +47,9 @@ class NodeInfo(betterproto.Message): node_status: str = betterproto.string_field(6) node_started_at: str = betterproto.string_field(7) node_finished_at: str = betterproto.string_field(8) - meta: str = betterproto.string_field(9) + meta: Dict[str, str] = betterproto.map_field( + 9, betterproto.TYPE_STRING, betterproto.TYPE_STRING + ) @dataclass @@ -162,7 +164,7 @@ class MissingProfileTargetMsg(betterproto.Message): class InvalidOptionYAML(betterproto.Message): """A008""" - option_name: str = betterproto.string_field(1) + pass @dataclass diff --git a/core/dbt/events/types.proto b/core/dbt/events/types.proto index 21f9c9ee4bb..15db910f144 100644 --- a/core/dbt/events/types.proto +++ b/core/dbt/events/types.proto @@ -124,12 +124,12 @@ message MissingProfileTargetMsg { // Skipped A006, A007 // A008 -message InvalidVarsYAML { +message InvalidOptionYAML { } -message InvalidVarsYAMLMsg { +message InvalidOptionYAMLMsg { EventInfo info = 1; - InvalidVarsYAML data = 2; + InvalidOptionYAML data = 2; } // A009 From 1b8b3a8387dda4cd20d9ae450ee9992c7fe622c1 Mon Sep 17 00:00:00 2001 From: Emily Rockman Date: Thu, 12 Jan 2023 11:33:53 -0600 Subject: [PATCH 2/2] add new parameter --- core/dbt/config/utils.py | 4 ++-- core/dbt/events/proto_types.py | 2 +- core/dbt/events/types.proto | 1 + core/dbt/exceptions.py | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/core/dbt/config/utils.py b/core/dbt/config/utils.py index cb7c90eac68..c69f0d5c79c 100644 --- a/core/dbt/config/utils.py +++ b/core/dbt/config/utils.py @@ -9,7 +9,7 @@ from dbt.config.renderer import DbtProjectYamlRenderer, ProfileRenderer from dbt.events.functions import fire_event from dbt.events.types import InvalidOptionYAML -from dbt.exceptions import DbtValidationError, OptionNotYamlDict +from dbt.exceptions import DbtValidationError, OptionNotYamlDictError def parse_cli_vars(var_string: str) -> Dict[str, Any]: @@ -23,7 +23,7 @@ def parse_cli_yaml_string(var_string: str, cli_option_name: str) -> Dict[str, An if var_type is dict: return cli_vars else: - raise OptionNotYamlDict(var_type, cli_option_name) + raise OptionNotYamlDictError(var_type, cli_option_name) except DbtValidationError: fire_event(InvalidOptionYAML(option_name=cli_option_name)) raise diff --git a/core/dbt/events/proto_types.py b/core/dbt/events/proto_types.py index 74858b828e9..da8721d55b9 100644 --- a/core/dbt/events/proto_types.py +++ b/core/dbt/events/proto_types.py @@ -164,7 +164,7 @@ class MissingProfileTargetMsg(betterproto.Message): class InvalidOptionYAML(betterproto.Message): """A008""" - pass + option_name: str = betterproto.string_field(1) @dataclass diff --git a/core/dbt/events/types.proto b/core/dbt/events/types.proto index 15db910f144..71e7fc3176c 100644 --- a/core/dbt/events/types.proto +++ b/core/dbt/events/types.proto @@ -125,6 +125,7 @@ message MissingProfileTargetMsg { // A008 message InvalidOptionYAML { + string option_name = 1; } message InvalidOptionYAMLMsg { diff --git a/core/dbt/exceptions.py b/core/dbt/exceptions.py index b8f99eb5fdc..4e7b6c9fe6a 100644 --- a/core/dbt/exceptions.py +++ b/core/dbt/exceptions.py @@ -1703,7 +1703,7 @@ def get_message(self) -> str: return msg -class OptionNotYamlDict(CompilationError): +class OptionNotYamlDictError(CompilationError): def __init__(self, var_type, option_name): self.var_type = var_type self.option_name = option_name