Skip to content

Commit 0d4cb43

Browse files
author
Drew Banin
committed
fix model validation in schema files
1 parent c56cb1c commit 0d4cb43

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

dbt/model.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ def __init__(self, project, target_dir, rel_filepath, own_project):
298298

299299
def get_model(self, project, model_name):
300300
rel_filepath = self.rel_filepath.replace('schema.yml', '{}.sql'.format(model_name))
301-
model = Model(project, self.top_dir, rel_filepath)
301+
model = Model(project, self.top_dir, rel_filepath, self.own_project, TestCreateTemplate())
302302
return model
303303

304304
def __repr__(self):

dbt/schema_tester.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,7 @@ def validate_schema(self, schemas):
191191
for model_name in schema.schema.keys():
192192
# skip this model if it's not enabled
193193
model = schema.get_model(self.project, model_name)
194-
config = model.get_config(self.project)
195-
if not config['enabled']:
194+
if not model.is_enabled:
196195
continue
197196

198197
constraints = schema.schema[model_name]['constraints']

0 commit comments

Comments
 (0)