Skip to content

Commit

Permalink
Rm more unused event types
Browse files Browse the repository at this point in the history
  • Loading branch information
jtcohen6 committed Dec 2, 2021
1 parent ff994b9 commit 353e2bd
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 58 deletions.
55 changes: 0 additions & 55 deletions core/dbt/events/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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):
Expand Down Expand Up @@ -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()
Expand Down
3 changes: 0 additions & 3 deletions test/unit/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -393,8 +392,6 @@ def MockNode():
MainReportArgs(Namespace()),
RegistryProgressMakingGETRequest(''),
DepsUTD(),
CatchRunException('', Exception('')),
HandleInternalException(Exception('')),
PartialParsingNotEnabled(),
SQlRunnerException(Exception('')),
DropRelation(''),
Expand Down

0 comments on commit 353e2bd

Please sign in to comment.