From 353e2bd2a65fa07cc662c31c0ee1ba4f7bd2d6be Mon Sep 17 00:00:00 2001 From: Jeremy Cohen Date: Thu, 2 Dec 2021 18:10:48 +0100 Subject: [PATCH] Rm more unused event types --- core/dbt/events/types.py | 55 ---------------------------------------- test/unit/test_events.py | 3 --- 2 files changed, 58 deletions(-) diff --git a/core/dbt/events/types.py b/core/dbt/events/types.py index 6a77bbd81e3..25f019d9456 100644 --- a/core/dbt/events/types.py +++ b/core/dbt/events/types.py @@ -832,50 +832,6 @@ def message(self) -> str: return "The YAML provided in the --vars argument is not valid." -# TODO: Remove? (appears to be uncalled) -@dataclass -class CatchRunException(ShowException, DebugLevel, Cli, File): - build_path: Any - exc: Exception - code: str = "I_NEED_A_CODE_1" - - def message(self) -> str: - INTERNAL_ERROR_STRING = """This is an error in dbt. Please try again. If the \ - error persists, open an issue at https://github.com/dbt-labs/dbt-core - """.strip() - prefix = f'Internal error executing {self.build_path}' - error = "{prefix}\n{error}\n\n{note}".format( - prefix=ui.red(prefix), - error=str(self.exc).strip(), - note=INTERNAL_ERROR_STRING - ) - return error - - def fields_to_json(self, val: Any) -> Any: - if val == self.exc: - return str(val) - - return val - - -# TODO: Remove? (appears to be uncalled) -@dataclass -class HandleInternalException(ShowException, DebugLevel, Cli, File): - exc: Exception - code: str = "I_NEED_A_CODE_2" - - def message(self) -> str: - return str(self.exc) - - def fields_to_json(self, val: Any) -> Any: - if val == self.exc: - return str(val) - - return val - -# TODO: Remove? (appears to be uncalled) - - @dataclass class MessageHandleGenericException(ErrorLevel, Cli, File): build_path: str @@ -899,16 +855,6 @@ def fields_to_json(self, val: Any) -> Any: return val -# TODO: Remove? (appears to be uncalled) - - -@dataclass -class DetailsHandleGenericException(ShowException, DebugLevel, Cli, File): - code: str = "I_NEED_A_CODE_4" - - def message(self) -> str: - return '' - @dataclass class GenericTestFileParse(DebugLevel, Cli, File): @@ -2721,7 +2667,6 @@ def message(self) -> str: InvalidDisabledSourceInTestNode(msg='') InvalidRefInTestNode(msg='') MessageHandleGenericException(build_path='', unique_id='', exc=Exception('')) - DetailsHandleGenericException() RunningOperationCaughtError(exc=Exception('')) RunningOperationUncaughtError(exc=Exception('')) DbtProjectError() diff --git a/test/unit/test_events.py b/test/unit/test_events.py index 4e613e6c3ef..1d8701fc04f 100644 --- a/test/unit/test_events.py +++ b/test/unit/test_events.py @@ -274,7 +274,6 @@ def MockNode(): InvalidDisabledSourceInTestNode(msg=''), InvalidRefInTestNode(msg=''), MessageHandleGenericException(build_path='', unique_id='', exc=Exception('')), - DetailsHandleGenericException(), RunningOperationCaughtError(exc=Exception('')), RunningOperationUncaughtError(exc=Exception('')), DbtProjectError(), @@ -393,8 +392,6 @@ def MockNode(): MainReportArgs(Namespace()), RegistryProgressMakingGETRequest(''), DepsUTD(), - CatchRunException('', Exception('')), - HandleInternalException(Exception('')), PartialParsingNotEnabled(), SQlRunnerException(Exception('')), DropRelation(''),