Skip to content

Fix row alignment when column selection heuristic excludes distinguishing columns#217

Open
jamesscottbrown wants to merge 1 commit intopaulfitz:masterfrom
jamesscottbrown:row-matching-fix
Open

Fix row alignment when column selection heuristic excludes distinguishing columns#217
jamesscottbrown wants to merge 1 commit intopaulfitz:masterfrom
jamesscottbrown:row-matching-fix

Conversation

@jamesscottbrown
Copy link

When a table has more than 5 columns, daff falls back on heuristics. These can fail, causing daff to incorrectly report that a row was deleted and another inserted, rather than reporting that a row was modified. This is Issue #216.

The PR is a proposed fix, created by an LLM (claude-opus-4.5). It looks plausible to me and the tests pass, but I am unfamiliar with the Haxe language and table-comparison logic is somewhat complex.

It adds a fallback matching mechanism in coopy/CompareTable.hx that:

  1. Identifies unmatched rows that are "sandwiched" between matched rows at the same relative positions
  2. Verifies the candidate row in B has no duplicates (to avoid ambiguous matching)
  3. Checks that more than half the columns match between the rows
  4. If all conditions are met, links the rows as a match

…hing columns

Co-authored-by: Shelley <shelley@exe.dev>
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