Repository navigation
Give every column its own random stream (1.26.0) - #72
Merged
Merged
Conversation
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 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
A table used to draw all its columns from one random stream, in column order. Inserting a column in the middle of
orderstherefore 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_seedsentry) 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.jsonis 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 lonecountrycolumn 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.--rows 20000: about 4% slower (saas_platform 11.7 s → 12.2 s).🤖 Generated with Claude Code