Skip to content

fix(duckshop): declare the columns staging models output and downstream models read - #1297

Merged
kvlonge merged 1 commit into
mainfrom
fix/duckshop-declared-columns
Nov 2, 2026
Merged

kvlonge merged 1 commit into
mainfrom
fix/duckshop-declared-columns

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Why

Sixteen DuckShop staging models output columns that their MODEL headers do not declare: the
source_seq and source_loaded_at load metadata from @sql.load_metadata, and in some models a
payload column such as contents, items or tier_history. Downstream models read those columns,
so a table built from the declared columns alone cannot serve them. Compiling every model against
empty tables created from the declarations failed for 17 downstream models with an invalid
identifier.

Changes

  • Declare the missing output columns of 16 staging models (catalogue, growth, inventory, partners,
    storefront and support), with the types and nullability the models produce.
  • Declarations only: no model body, test or compiled SQL changes.

Verification

  • sqb compile with sqlbuild 0.187.0: 0 errors, 0 warnings.
  • The core copy's compiled checksum is unchanged
    (1ff1d0955ea3839b3c969707fd47ca9a4d7d7216753759d23911836f6ea5879d).
  • DuckShop pytest suites (benchmarks/duckshop/tests, project/tests): 291 passed, 3 skipped.
  • A name check of every core model against tables built from the new declarations resolves every
    column read.
  • make check-ci passes.

…am models read

Sixteen staging models output source_seq and source_loaded_at, and some a payload column, that their MODEL headers did not declare, although downstream models read them. Declaring them makes each declared schema cover what its readers use, so tables created from the declarations support every downstream model. Compiled SQL is unchanged.
@kvlonge
kvlonge enabled auto-merge (squash) November 2, 2026 05:56
@kvlonge
kvlonge merged commit 43448ef into main Nov 2, 2026
26 checks passed
@kvlonge
kvlonge deleted the fix/duckshop-declared-columns branch November 2, 2026 07:11
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