Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/sha256 #9

Merged
merged 2 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/matchbox/common/hash.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
T = TypeVar("T")
HashableItem = TypeVar("HashableItem", bytes, bool, str, int, float, bytearray)

HASH_FUNC = hashlib.sha1
HASH_FUNC = hashlib.sha256


def dataset_to_hashlist(dataset: Source, model_hash: bytes) -> list[dict[str, Any]]:
Expand Down
5 changes: 3 additions & 2 deletions src/matchbox/server/postgresql/utils/insert.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def insert_model(
Args:
model: Name of the new model
left: Name of the left parent model
right: Name of the left parent model. Same as left in a link job
right: Name of the right parent model. Same as left in a link job
description: Model description
engine: SQLAlchemy engine instance

Expand All @@ -139,7 +139,8 @@ def insert_model(
session.flush()

def _create_closure_entries(parent_model: Models) -> None:
"""Create closure entries for the new model."""
"""Create closure entries for the new model, i.e. mappings between
nodes and any of their direct or indirect parents"""
session.add(
ModelsFrom(
parent=parent_model.hash,
Expand Down
1 change: 0 additions & 1 deletion test/client/test_linkers.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ def test_linkers(
1. That the input data is as expected
2. That the data is linked correctly
3. That the linked probabilities are inserted correctly
4. That the correct number of clusters are resolved
4. That the correct number of clusters are resolved and inserted correctly
"""
# i. Ensure database is ready, collect fixtures, perform any special linker cleaning
Expand Down