We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 65774e6 commit c1f9c13Copy full SHA for c1f9c13
sqlmesh/dbt/test.py
@@ -122,7 +122,14 @@ def is_standalone(self) -> bool:
122
return True
123
124
# Check if test has references to other models
125
- other_refs = {ref for ref in self.dependencies.refs if ref != self.model_name}
+ # For versioned models, refs include version (e.g., "model_name_v1") but model_name doesn't
126
+ self_refs = {self.model_name}
127
+ for ref in self.dependencies.refs:
128
+ # versioned models end in _vX
129
+ if ref.startswith(f"{self.model_name}_v"):
130
+ self_refs.add(ref)
131
+
132
+ other_refs = {ref for ref in self.dependencies.refs if ref not in self_refs}
133
return bool(other_refs)
134
135
@property
0 commit comments