Skip to content

fix: skip target retention defaults for views - #793

Merged
kvlonge merged 1 commit into
mainfrom
fix/target-retention-skips-views
Sep 23, 2026
Merged

kvlonge merged 1 commit into
mainfrom
fix/target-retention-skips-views

Conversation

@kvlonge

@kvlonge kvlonge commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Why

A target-level time_travel_retention default was applied to every model, including views. Compilation then failed with "managed time_travel_retention is not valid for views", so a target could not set a retention default for its table-backed models without annotating every view.

Changes

  • The target retention default now applies only to table-backed materializations (table, incremental, snapshot), matching how default_table_type works. Other materializations resolve it as unmanaged.
  • Precedence is unchanged: the model header wins over materialization_defaults, which wins over the target.
  • Retention declared explicitly on a view is still rejected.

Verification

  • New CLI integration test: sqb compile with [targets.prod] time_travel_retention = "90d" passes with a view, and still fails when the view declares retention itself. The first case fails on main.
  • New unit cases: an incremental model inherits the target default, and a view does not.
  • Focused compile, config, retention and target tests pass (927). make check-ci passes, and the public-repository scan is clean.

@kvlonge
kvlonge enabled auto-merge (squash) September 23, 2026 15:21
@kvlonge
kvlonge merged commit 3d1dd48 into main Sep 23, 2026
28 checks passed
@kvlonge
kvlonge deleted the fix/target-retention-skips-views branch September 23, 2026 15:36
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