-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add factory wrappers to renamed_relations (#9682)
* Add factory wrappers to renamed_relations * add test and postgres semantics --------- Co-authored-by: Mila Page <[email protected]> Co-authored-by: Mike Alfare <[email protected]>
- Loading branch information
1 parent
a0372fc
commit 27e17a7
Showing
4 changed files
with
43 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: Fixes | ||
body: Add field wrapper to BaseRelation members that were missing it. | ||
time: 2024-02-26T21:58:42.161273-08:00 | ||
custom: | ||
Author: versusfacit | ||
Issue: "9681" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from dbt.adapters.postgres.relation import PostgresRelation | ||
from dbt.contracts.relation import RelationType | ||
|
||
|
||
def test_renameable_relation(): | ||
relation = PostgresRelation.create( | ||
database="my_db", | ||
schema="my_schema", | ||
identifier="my_table", | ||
type=RelationType.Table, | ||
) | ||
assert relation.renameable_relations == frozenset( | ||
{ | ||
RelationType.View, | ||
RelationType.Table, | ||
RelationType.MaterializedView, | ||
} | ||
) |