sqlmesh.core.audit API documentation

Edit on GitHub

# sqlmesh.core.audit

View Source

     1import inspect
     2import typing as t
     3from types import ModuleType
     4
     5from sqlmesh.core.audit import builtin
     6from sqlmesh.core.audit.definition import Audit, AuditResult
     7
     8
     9def _discover_audits(modules: t.Iterable[ModuleType]) -> t.Dict[str, Audit]:
    10    return {
    11        audit.name: audit
    12        for module in modules
    13        for _, audit in inspect.getmembers(module, lambda v: isinstance(v, Audit))
    14    }
    15
    16
    17BUILT_IN_AUDITS = _discover_audits([builtin])