Skip to content

fix(seeds): resolve seed file paths from the package root - #16129

Open
fornwall wants to merge 1 commit into
dbt-labs:mainfrom
fornwall:path-fix
Open

fornwall wants to merge 1 commit into
dbt-labs:mainfrom
fornwall:path-fix

Conversation

@fornwall

@fornwall fornwall commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Resolves #16127 and #16128.

The same path handling existed in four places: resolve_seed_path() and has_same_content() joined the package root with the package-relative path correctly, while adapter.get_seed_file_path() and the BigQuery seed macro each derived it incorrectly. All four now go through a new DbtSeed::resolve_file_path() function.

Only DuckDB and BigQuery exposed the bug. Other adapters insert rows from agate_table, which has already been read from the resolved path; DuckDB and BigQuery instead pass the CSV path to the engine from Jinja:

  • BigQuery: the macro built its path from a non-existing model['project_root'], so the expression collapsed to the bare project-relative original_file_path. The driver resolved that against the process working directory -> seeds loaded when dbt ran from the project root, and missed otherwise.
  • DuckDB: get_seed_file_path joined the package root with original_file_path, which already carries dbt_packages/<pkg>. The prefix was repeated, and the COPY failed for every seed in an installed package.

@fornwall
fornwall requested a review from a team as a code owner August 29, 2026 22:32
@cla-bot cla-bot Bot added the cla:yes label Aug 29, 2026
codescene-delta-analysis[bot]

This comment was marked as outdated.

Comment thread crates/dbt-adapter/src/adapter/mod.rs Outdated
codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

@fornwall
fornwall force-pushed the path-fix branch 2 times, most recently from 11669f9 to 1f5debf Compare August 29, 2026 23:39
codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

Resolver-built seeds store their package root separately from their
package-relative path. Use that pair consistently instead of rebuilding
file locations from project-relative original_file_path.

This fixes DuckDB dependency seeds, which duplicated the package prefix,
and BigQuery seeds run outside the project root, which previously used a
cwd-relative path. It also removes the now-unused in_dir fallback.

Cover shared path resolution, adapter serialization, and BigQuery macro
forwarding separately.

Signed-off-by: Fredrik Fornwall <fredrik@fornwall.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[v2 Bug] BigQuery seeds only works when standing in project root

1 participant