Skip to content

Give every column its own random stream (1.26.0) - #72

Merged
jarichb merged 2 commits into
mainfrom
claude/stable-columns
Nov 26, 2026
Merged

jarichb merged 2 commits into
mainfrom
claude/stable-columns

Conversation

@jarichb

@jarichb jarichb commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

What changes

A table used to draw all its columns from one random stream, in column order. Inserting a column in the middle of orders therefore changed every column after it, and adding a table or a rule could shift values elsewhere.

Now every column, rule, composite key and person/address pool draws from a stream of its own, derived from the run's seed, the table (and its table_seeds entry) and its own name (model2data/generate/streams.py). Adding, removing or moving a column, adding a table, a rule or a composite key leaves the columns they do not touch as they were, on the first day and on the days after it.

One-time data change

The rows every model generates for a given seed change once, in this release. tests/fixtures/determinism.json is re-recorded, and the CHANGELOG says plainly that dbt projects with saved expected values need them regenerated once. Two documented places where table shape still matters: a lone country column becomes the locale's country once an address column joins it, and a new lifecycle date joins the date ordering by name.

Checks

  • tests/test_stable_columns.py: six column kinds plus a foreign key inserted first, middle and last; every table of all 16 example models; removing and swapping columns; adding tables, rules and composite keys; table_seeds; the days after the first. The test fails with the per-column reseeding switched off.
  • Full suite: 3300 passed, 39 skipped. ruff clean.
  • Generation at --rows 20000: about 4% slower (saas_platform 11.7 s → 12.2 s).

🤖 Generated with Claude Code

A table used to draw all its columns from one stream in order, so adding,
removing or moving a column changed the values of every column after it.
Each column, rule, composite key and person/address pool now draws from a
stream derived from the run's seed, the table and its own name, so a change
to one column leaves the others as they were, on the first day and after.

This changes the rows every model generates for a given seed, once; the
determinism fixtures are re-recorded and the CHANGELOG says so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jarichb
jarichb merged commit 5b462f3 into main Nov 26, 2026
12 checks passed
@jarichb
jarichb deleted the claude/stable-columns branch November 26, 2026 15:19
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