Skip to content

fix: read Python node fingerprints from the preserved loader schema - #1560

Merged
kvlonge merged 3 commits into
mainfrom
fix/preserved-node-fingerprints
Nov 17, 2026
Merged

kvlonge merged 3 commits into
mainfrom
fix/preserved-node-fingerprints

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Why

Under a target with schema = "preserve", Python nodes keep their results and identity fingerprints in loader_schema. Two paths disagreed with that:

  • Planning read fingerprints only from model, seed and function schemas, so every plan showed loaders, tasks and assets as new.
  • The check that a preserved target has somewhere to keep node results looked at the raw loader_schema. A value that resolves to empty, or only to a model-context placeholder, passed the check and the build then fell back to the adapter's default location.

Changes

  • The preserved-target node results check expands loader_schema with the effective vars and uses the same usability test as the runtime location (non-empty, not preserve, no context placeholder).
  • Planning passes the node results location into the warehouse snapshot, which reads that schema's fingerprints table without listing its other relations.
  • dbt interop plans are unchanged: no path puts loader source nodes in them.

Verification

  • New e2e cases in test_node_result_location.py: a task under a preserved schema, a loader schema var that resolves to empty, a loader schema that resolves only inside a model, and plans that read a task's fingerprint from the loader schema (whole project and the task alone) or from a named target schema. The refusal and plan cases failed before their fix.
  • Targeted build, plan and load tests pass.
  • make check-ci passes on this head.

The preserved-target node results check now expands loader_schema with
the effective vars and applies the same usability test as the runtime
location: non-empty, not preserve, and no context placeholder. A target
whose loader_schema resolves to nothing usable is refused before the
build instead of writing results to the wrong schema.
…lanning

Under a preserved target schema, Python nodes record their results and
fingerprints in the loader schema, which planning never read, so every
plan showed loaders, tasks and assets as new. Planning now passes the
node results location into the warehouse snapshot, which reads that
schema's fingerprints table without listing its other relations.
@kvlonge
kvlonge enabled auto-merge November 17, 2026 21:53
@kvlonge
kvlonge added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit 2f0ef09 Nov 17, 2026
32 checks passed
@kvlonge
kvlonge deleted the fix/preserved-node-fingerprints branch November 17, 2026 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant