Skip to content

Commit 2c42379

Browse files
committed
fix: pydantic v1 issues with dbt 1.6 semantic models
1 parent 5011741 commit 2c42379

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

sqlmesh/dbt/manifest.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,13 @@
8080
IGNORED_PACKAGES = {"elementary"}
8181
BUILTIN_CALLS = {*BUILTIN_GLOBALS, *BUILTIN_FILTERS}
8282

83+
# Patch Semantic Manifest to skip validation and avoid Pydantic v1 errors on DBT 1.6
84+
# We patch for 1.7+ since we don't care about semantic models
85+
if DBT_VERSION >= (1, 6, 0):
86+
from dbt.contracts.graph.semantic_manifest import SemanticManifest # type: ignore
87+
88+
SemanticManifest.validate = lambda _: True # type: ignore
89+
8390

8491
class ManifestHelper:
8592
def __init__(
@@ -456,6 +463,8 @@ def _load_manifest(self) -> Manifest:
456463
register_adapter(runtime_config) # type: ignore
457464

458465
manifest = ManifestLoader.get_full_manifest(runtime_config)
466+
# This adapter doesn't care about semantic models so we clear them out to avoid issues
467+
manifest.semantic_models = {}
459468
reset_adapters()
460469
return manifest
461470

0 commit comments

Comments
 (0)