You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Dedup pass 2 over-merges: winner picked from full normalized-label groups pulls in never-compared nodes #1247
In deduplicate_entities pass 2 (graphify/dedup.py), when a fuzzy pair (node, neighbor) passes all guards and reaches the merge step, the winner is selected from the union of both normalized-label groups:
norm_to_nodes[norm_label] contains every node sharing that normalized label — including same-label/different-source_file nodes that pass 1 deliberately kept separate (#1178) and that the pass-2 identical-label cross-file guard (#1046) also refuses to merge. If _pick_winner selects one of those never-compared nodes, the two uf.union calls merge it with both members of the verified pair, silently bypassing both guards.
Only the typo pair (Session Manager / Session Managr) was ever verified by Jaro-Winkler. sm (same label as A, different file) was never compared against anything, yet _pick_winner selects it (shortest id) and both unions run through it — all three nodes collapse into one. Expected: the verified pair merges, sm stays distinct (2 nodes).
Proposed solution
Pick the winner from the verified pair only:
winner=_pick_winner([node, neighbor])
Group members that genuinely belong together are still reachable: same-file duplicates were already unioned in pass 1, and any other member must win its own guarded comparison to join.
Acceptance criteria
The reproduction above yields 2 nodes, with sm surviving as a distinct node.
Regression test covering the scenario in tests/test_dedup.py.
Activity
fix(dedup): pick pass-2 winner from the verified pair only (#1247)
Merge pull request #1248 from teemow/fix/dedup-pass2-winner-union
fix(dedup): pick pass-2 winner from the verified pair only (Graphify-…
Merge pull request Graphify-Labs#1248 from teemow/fix/dedup-pass2-win…