Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions sqlmesh/dbt/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,16 +360,20 @@ def _load_models_and_seeds(self) -> None:
)

self._models_per_package[node.package_name][node_name] = ModelConfig(
sql=sql,
dependencies=dependencies,
tests=tests,
**node_config,
**dict(
node_config,
sql=sql,
dependencies=dependencies,
tests=tests,
)
)
else:
self._seeds_per_package[node.package_name][node_name] = SeedConfig(
dependencies=Dependencies(macros=macro_references),
tests=tests,
**node_config,
**dict(
node_config,
dependencies=Dependencies(macros=macro_references),
tests=tests,
)
)

def _load_on_run_start_end(self) -> None:
Expand Down
3 changes: 2 additions & 1 deletion tests/dbt/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ def test_load_invalid_ref_audit_constraints(
dbt_project_dir.mkdir()
dbt_model_dir = dbt_project_dir / "models"
dbt_model_dir.mkdir()
full_model_contents = "SELECT 1 as cola"
# add `tests` to model config since this is loaded by dbt and ignored and we shouldn't error when loading it
full_model_contents = """{{ config(tags=["blah"], tests=[{"blah": {"to": "ref('completely_ignored')", "field": "blah2"} }]) }} SELECT 1 as cola"""
full_model_file = dbt_model_dir / "full_model.sql"
with open(full_model_file, "w", encoding="utf-8") as f:
f.write(full_model_contents)
Expand Down