sqlmesh.utils.errors
1from __future__ import annotations 2 3import typing as t 4from enum import auto 5from pathlib import Path 6 7from sqlglot.helper import AutoName 8 9 10class ErrorLevel(AutoName): 11 IGNORE = auto() 12 WARN = auto() 13 RAISE = auto() 14 15 16class SQLMeshError(Exception): 17 pass 18 19 20class ConfigError(SQLMeshError): 21 pass 22 23 24class MissingDependencyError(SQLMeshError): 25 """Local environment is missing a required dependency for the given operation""" 26 27 28class MacroEvalError(SQLMeshError): 29 pass 30 31 32class PlanError(SQLMeshError): 33 pass 34 35 36class MissingContextException(Exception): 37 pass 38 39 40class SnapshotVersionError(SQLMeshError): 41 pass 42 43 44class MagicError(SQLMeshError): 45 pass 46 47 48class AuditConfigError(ConfigError): 49 pass 50 51 52class AuditError(SQLMeshError): 53 pass 54 55 56class NotificationTargetError(SQLMeshError): 57 pass 58 59 60class ApiError(SQLMeshError): 61 pass 62 63 64class ApiClientError(ApiError): 65 pass 66 67 68class ApiServerError(ApiError): 69 pass 70 71 72class NotFoundError(ApiClientError): 73 pass 74 75 76def raise_config_error( 77 msg: str, 78 location: t.Optional[str | Path] = None, 79 error_type: t.Type[ConfigError] = ConfigError, 80) -> None: 81 if location: 82 raise error_type(f"{msg} at '{location}'") 83 raise error_type(msg)
class
ErrorLevel(sqlglot.helper.AutoName):
An enumeration.
IGNORE = <ErrorLevel.IGNORE: 'IGNORE'>
WARN = <ErrorLevel.WARN: 'WARN'>
RAISE = <ErrorLevel.RAISE: 'RAISE'>
Inherited Members
- enum.Enum
- name
- value
class
SQLMeshError(builtins.Exception):
Common base class for all non-exit exceptions.
Inherited Members
- builtins.Exception
- Exception
- builtins.BaseException
- with_traceback
Common base class for all non-exit exceptions.
Inherited Members
- builtins.Exception
- Exception
- builtins.BaseException
- with_traceback
25class MissingDependencyError(SQLMeshError): 26 """Local environment is missing a required dependency for the given operation"""
Local environment is missing a required dependency for the given operation
Inherited Members
- builtins.Exception
- Exception
- builtins.BaseException
- with_traceback
Common base class for all non-exit exceptions.
Inherited Members
- builtins.Exception
- Exception
- builtins.BaseException
- with_traceback
Common base class for all non-exit exceptions.
Inherited Members
- builtins.Exception
- Exception
- builtins.BaseException
- with_traceback
class
MissingContextException(builtins.Exception):
Common base class for all non-exit exceptions.
Inherited Members
- builtins.Exception
- Exception
- builtins.BaseException
- with_traceback
Common base class for all non-exit exceptions.
Inherited Members
- builtins.Exception
- Exception
- builtins.BaseException
- with_traceback
Common base class for all non-exit exceptions.
Inherited Members
- builtins.Exception
- Exception
- builtins.BaseException
- with_traceback
Common base class for all non-exit exceptions.
Inherited Members
- builtins.Exception
- Exception
- builtins.BaseException
- with_traceback
Common base class for all non-exit exceptions.
Inherited Members
- builtins.Exception
- Exception
- builtins.BaseException
- with_traceback
Common base class for all non-exit exceptions.
Inherited Members
- builtins.Exception
- Exception
- builtins.BaseException
- with_traceback
Common base class for all non-exit exceptions.
Inherited Members
- builtins.Exception
- Exception
- builtins.BaseException
- with_traceback
Common base class for all non-exit exceptions.
Inherited Members
- builtins.Exception
- Exception
- builtins.BaseException
- with_traceback
Common base class for all non-exit exceptions.
Inherited Members
- builtins.Exception
- Exception
- builtins.BaseException
- with_traceback
Common base class for all non-exit exceptions.
Inherited Members
- builtins.Exception
- Exception
- builtins.BaseException
- with_traceback
def
raise_config_error( msg: str, location: Union[str, pathlib.Path, NoneType] = None, error_type: Type[sqlmesh.utils.errors.ConfigError] = <class 'sqlmesh.utils.errors.ConfigError'>) -> None: