Skip to content

Commit 838002a

Browse files
committed
remove redundant logic
1 parent 92df032 commit 838002a

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

sqlmesh/core/linter/rules/builtin.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,10 @@ class FilenameEqualsModelname(Rule):
6262

6363
def check_model(self, model: Model) -> t.Optional[RuleViolation]:
6464
# Rule violated if the model's name (schema.table_name) does not match the file name (foo/bar/table_name.sql).
65-
full_model_name = model.name
66-
table_name = full_model_name.split(".")[-1]
67-
path = Path(model._path)
6865
return (
69-
self.violation() if (table_name != path.stem) and not model.kind.is_symbolic else None
66+
self.violation()
67+
if (model.name.split(".")[-1] != Path(model._path).stem) and not model.kind.is_symbolic
68+
else None
7069
)
7170

7271

0 commit comments

Comments
 (0)