Compare commits

...

1 Commits

Author SHA1 Message Date
Sung Won Chung
e879cdd5fb start off the blueprints 2022-11-07 12:13:56 -08:00
3 changed files with 14 additions and 0 deletions

View File

@@ -296,6 +296,17 @@ class UndefinedMacroException(CompilationException):
)
# TODO: create a new class that displays in the terminal that a data type config is missing/wrong
class UndefinedDataTypeException(CompilationException):
def __str__(self, prefix="! ") -> str:
msg = super().__str__(prefix)
return (
f"{msg}. This can happen when a data_type configuration does "
"not exist or is defined as null when `constraints_enabled: true` for a dbt model. \
Check for typos and/or verify data_type is defined for all columns for the dbt models with constraints. "
)
class UnknownAsyncIDException(Exception):
CODE = 10012
MESSAGE = "RPC server got an unknown async ID"

View File

@@ -180,6 +180,7 @@ class GenericTestBlock(TestBlock[Testable], Generic[Testable]):
)
# TODO: create a ConstraintsBuilder equivalent
class TestBuilder(Generic[Testable]):
"""An object to hold assorted test settings and perform basic parsing
@@ -194,6 +195,7 @@ class TestBuilder(Generic[Testable]):
r"((?P<test_namespace>([a-zA-Z_][0-9a-zA-Z_]*))\.)?"
r"(?P<test_name>([a-zA-Z_][0-9a-zA-Z_]*))"
)
# TODO: add config args like: "default", "data_type", "constraint", "check"
# args in the test entry representing test configs
CONFIG_ARGS = (
"severity",

View File

@@ -169,6 +169,7 @@ def _trimmed(inp: str) -> str:
return inp[:44] + "..." + inp[-3:]
# TODO: I'll likely need to add a ConstraintsBuilder class similar to TestBuilder within SchemaParser
class SchemaParser(SimpleParser[GenericTestBlock, ParsedGenericTestNode]):
def __init__(
self,