Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 1.0.0] respect project root when loading seeds (#8762) #8816

Merged
merged 2 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixes-20231006-134551.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: Enable seeds to be handled from stored manifest data
time: 2023-10-06T13:45:51.925546-04:00
custom:
Author: michelleark
Issue: "6875"
13 changes: 11 additions & 2 deletions core/dbt/context/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -769,9 +769,18 @@ def load_agate_table(self) -> agate.Table:
'can only load_agate_table for seeds (got a {})'
.format(self.model.resource_type)
)
path = os.path.join(
self.model.root_path, self.model.original_file_path

# include package_path for seeds defined in packages
package_path = (
os.path.join(self.config.packages_install_path, self.model.package_name)
if self.model.package_name != self.config.project_name
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
try:
table = agate_helper.from_csv(path, text_columns=column_types)
Expand Down
Loading
Loading