Skip to content

Commit

Permalink
fallback to existing model.root_path behaviour for seed loading
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelleArk committed Oct 6, 2023
1 parent 0494a17 commit 8e46d49
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 3 additions & 0 deletions core/dbt/context/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,9 @@ def load_agate_table(self) -> agate.Table:
else "."
)
path = os.path.join(self.config.project_root, package_path, self.model.original_file_path)
if not os.path.exists(path):
assert self.model.root_path
path = os.path.join(self.model.root_path, self.model.original_file_path)

column_types = self.model.config.column_types
delimiter = self.model.config.delimiter
Expand Down
1 change: 0 additions & 1 deletion core/dbt/contracts/graph/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,6 @@ class SeedNode(ParsedNode): # No SQLDefaults!
config: SeedConfig = field(default_factory=SeedConfig)
# seeds need the root_path because the contents are not loaded initially
# and we need the root_path to load the seed later
# TODO: remove root_path as it is unused, and instead computed dynamically in load_agate_table
root_path: Optional[str] = None
depends_on: MacroDependsOn = field(default_factory=MacroDependsOn)
defer_relation: Optional[DeferRelation] = None
Expand Down

0 comments on commit 8e46d49

Please sign in to comment.