Skip to content

test(diff): a worked example of the diff over two five-row tables - #316

Merged
paddymul merged 2 commits into
mainfrom
test/diff-by-example
Oct 7, 2026
Merged

paddymul merged 2 commits into
mainfrom
test/diff-by-example

Conversation

@paddymul

@paddymul paddymul commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

What this adds

tests/test_diff_by_example.py: the diff of two five-row tables, written so that the code can be read and the result checked by eye. It changes no source.

The tables are joined on a_primary:

before                              after
a_primary  b_int  c_float           a_primary  c_float  d_string
1          100    1.5               1          1.5      one
2          200    2.5               2          5.0      two
3          300    3.5               3          3.0      three
10         1000   10.5              20         20.5     twenty
11         1100   11.5              21         21.5     twenty-one

Keys 1, 2 and 3 are in both: key 1 is identical, keys 2 and 3 differ in c_float. Keys 10 and 11 are only before, keys 20 and 21 only after. b_int is only in before and d_string only in after, so c_float is the one non-key column both sides have.

No Buckaroo server, session or grid is involved. build_compare_expr imports one helper (_align_backends) from the buckaroo package, and tallyman_xorq.diff, which holds schema_diff, imports buckaroo.compare when it loads.

Verification

Local: tests/test_diff_by_example.py and tests/test_diff.py together: 45 passed, 1 xfailed. uvx ruff check: clean. The rest of the suite is left to CI.

The tests pass today, apart from the strict xfail, so there is no red commit.

🤖 Generated with Claude Code

paddymul and others added 2 commits October 7, 2026 11:57
Two tables of five rows share three keys. One of the three is identical and two differ in c_float, and each table has two keys of its own. b_int is only in the before table and d_string only in the after table. The tests write the expected compare table out row by row, with the membership and equality codes named, so the diff can be checked by eye. No Buckaroo server, session or grid is involved.

d_string never appears in the compare table (#275), so that expectation is a strict xfail that fails once #275 is fixed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@paddymul
paddymul merged commit bdd28ab into main Oct 7, 2026
3 checks passed
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