Skip to content

Commit 712931d

Browse files
committed
PR feedback
1 parent 591cba7 commit 712931d

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

sqlmesh/dbt/adapter.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -356,16 +356,10 @@ def drop_relation(self, relation: BaseRelation) -> None:
356356
self.engine_adapter.drop_table(self._normalize(self._relation_to_table(relation)))
357357

358358
def rename_relation(self, from_relation: BaseRelation, to_relation: BaseRelation) -> None:
359-
old_table_name = None
360-
if from_relation.schema is not None and from_relation.identifier is not None:
361-
old_table_name = self._normalize(self._relation_to_table(from_relation))
359+
old_table_name = self._normalize(self._relation_to_table(from_relation))
360+
new_table_name = self._normalize(self._relation_to_table(to_relation))
362361

363-
new_table_name = None
364-
if to_relation.schema is not None and to_relation.identifier is not None:
365-
new_table_name = self._normalize(self._relation_to_table(to_relation))
366-
367-
if old_table_name and new_table_name:
368-
self.engine_adapter.rename_table(old_table_name, new_table_name)
362+
self.engine_adapter.rename_table(old_table_name, new_table_name)
369363

370364
def execute(
371365
self, sql: str, auto_begin: bool = False, fetch: bool = False

0 commit comments

Comments
 (0)