Skip to content

Commit

Permalink
update type for mashumaro, update related test
Browse files Browse the repository at this point in the history
  • Loading branch information
mikealfare committed Aug 31, 2023
1 parent a7db607 commit 8b643bd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
3 changes: 1 addition & 2 deletions core/dbt/adapters/base/relation.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
Policy,
Path,
)
from dbt.dataclass_schema import StrEnum
from dbt.exceptions import (
ApproximateMatchError,
DbtInternalError,
Expand All @@ -37,7 +36,7 @@ class BaseRelation(FakeAPIObject, Hashable):
quote_policy: Policy = field(default_factory=lambda: Policy())
dbt_created: bool = False
# register relation types that can be renamed for the purpose of replacing relations using stages and backups
renameable_relations: List[StrEnum] = field(
renameable_relations: List[str] = field(
default_factory=lambda: [RelationType.Table, RelationType.View]
)

Expand Down
5 changes: 1 addition & 4 deletions tests/unit/test_relation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from dataclasses import replace

import pytest

from dbt.adapters.base import BaseRelation
Expand All @@ -10,10 +8,9 @@
"relation_type,result",
[
(RelationType.View, True),
(RelationType.Table, False),
(RelationType.External, False),
],
)
def test_can_be_renamed(relation_type, result):
my_relation = BaseRelation.create(type=relation_type)
my_relation = replace(my_relation, renameable_relations=[RelationType.View])
assert my_relation.can_be_renamed is result

0 comments on commit 8b643bd

Please sign in to comment.