-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #81 from nicholasyager/fix/grandparent_seeds
Fix: Add resource type mismatch checks to prevent compilation errors for grandparent projects with seeds
- Loading branch information
Showing
3 changed files
with
46 additions
and
10 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
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,23 @@ | ||
from dbt_loom.manifests import ManifestNode | ||
|
||
|
||
try: | ||
from dbt.artifacts.resources.types import NodeType | ||
except ModuleNotFoundError: | ||
from dbt.node_types import NodeType # type: ignore | ||
|
||
|
||
def test_rewrite_resource_types(): | ||
"""Confirm that resource types are rewritten if they are incorrect due to previous injections.""" | ||
|
||
node = { | ||
"unique_id": "seed.example.foo", | ||
"name": "foo", | ||
"package_name": "example", | ||
"schema": "bar", | ||
"resource_type": "model", | ||
} | ||
|
||
manifest_node = ManifestNode(**(node)) # type: ignore | ||
|
||
assert manifest_node.resource_type == NodeType.Seed |