Skip to content

Reject incompatible MinHashLSH merges#328

Open
dipeshbabu wants to merge 1 commit into
ekzhu:masterfrom
dipeshbabu:agent/reject-incompatible-lsh-merges
Open

Reject incompatible MinHashLSH merges#328
dipeshbabu wants to merge 1 commit into
ekzhu:masterfrom
dipeshbabu:agent/reject-incompatible-lsh-merges

Conversation

@dipeshbabu

Copy link
Copy Markdown
Contributor

What

Require matching key serialization, band hash callables, and byte-key requirements in addition to the existing band layout checks before merging indexes.

Why

Copying rows from an index with a different band hash function makes those entries unreachable. Mixing pickled and raw key representations also corrupts membership and query behavior.

Impact

Incompatible merges now fail before mutating the destination. Compatible indexes with different thresholds, weights, or storage backends can still merge when their effective representation matches.

Root cause

The equivalence check covered only num_perm, band count, and band size.

Checks

  • uv run pytest -q test/test_lsh.py (26 passed)
  • uv run ruff check datasketch/lsh.py test/test_lsh.py
  • uvx pyright (0 errors)
  • git diff --check

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (master@3da96a5). Learn more about missing BASE report.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #328   +/-   ##
=========================================
  Coverage          ?   69.86%           
=========================================
  Files             ?       21           
  Lines             ?     2787           
  Branches          ?        0           
=========================================
  Hits              ?     1947           
  Misses            ?      840           
  Partials          ?        0           
Flag Coverage Δ
unittests 69.86% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants