Skip to content

Spec 0.10.0: via on a copied value; locale country names; no titles in names - #73

Merged
jarichb merged 4 commits into
mainfrom
claude/copy-via
Nov 26, 2026
Merged

jarichb merged 4 commits into
mainfrom
claude/copy-via

Conversation

@jarichb

@jarichb jarichb commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Completes 1.26.0 together with #72, so the rows change once, in one release. The CHANGELOG has a single ## [1.26.0] - Unreleased section for both.

What changes

  • via on a copied value (model spec 0.10.0). A column that copies a parent's plain column (references: teams.venue_id) used to follow the first foreign key to that parent, silently. references now takes via: {to: teams.venue_id, via: home_team_id}. Two or more possible foreign keys and no via is a validation error at any spec version, naming every path, and the error carries the fix as an Issue.suggestion. model2data.model.fill_copy_paths(model) adds the first path to an existing model, which keeps the rows it generated before. Spec versions now compare as numbers, so 0.10.0 is newer than 0.9.0.
  • Country names follow the locale. With a named locale the home country is spelled as that locale spells it (Deutschland, België); without a locale nothing changes. babel is now a direct dependency (it was already installed through dbt-core).
  • name_male, name_female, name_nonbinary have no titles: first name plus last name, like name.
  • model2data.model.nullable_foreign_keys(model) lists each nullable foreign key with the share of rows the engine leaves empty.

Checks

  • New tests: tests/test_copy_via.py, tests/test_locale_names.py, tests/test_nullable_foreign_keys.py.
  • Determinism fixtures re-recorded on top of Give every column its own random stream (1.26.0) #72; only the locale-de_DE, locale-en_US, locale-nl_BE and locale-ja_JP cases move, because of the country spelling.
  • Full suite, dbt tests included: 3355 passed, 39 skipped. ruff clean.

🤖 Generated with Claude Code

jarichb and others added 3 commits November 26, 2026 16:16
…foreign keys helper

A copied value read through one of several foreign keys onto its parent now
names it with via; two or more and no via is an error. fill_copy_paths writes
the first foreign key in, which is what earlier versions read. The home country
of a named locale is spelled as the locale's list spells it, name_male,
name_female and name_nonbinary carry no titles, and nullable_foreign_keys lists
the foreign keys a model leaves empty on some rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
babel names the home country in the locale's own language. The via migration
test now compares against naming the first foreign key by hand.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One release changes the rows once: the 1.27.0 entries join 1.26.0's.

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!

Babel is a direct dependency, so it is imported at the top and its English
fallback is gone. A one-column foreign_keys entry cannot exist (the schema
asks for two columns), so nothing counts it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jarichb
jarichb merged commit c060f50 into main Nov 26, 2026
12 checks passed
@jarichb
jarichb deleted the claude/copy-via branch November 26, 2026 20:37
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