Add unit tests for hash utils, ID generation, and reranker utils#5
Merged
fbmz-improving merged 1 commit intomainfrom Feb 19, 2026
Merged
Conversation
- Add test_hash_utils.py: 6 tests covering get_hash determinism, known MD5 vector, uniqueness, unicode, empty string, and hex format - Add test_id_generator.py: 22 tests covering create_source_id, create_chunk_id, create_entity_id, create_topic_id, create_statement_id, create_fact_id, rewrite_id_for_tenant, and tenant isolation across all node types - Add test_reranker_utils.py: 7 tests covering to_float numpy coercion and score_values_with_tfidf return type, ordering, and non-negative scores
Collaborator
|
Please look into the warnings from the run too: |
acarbonetto
approved these changes
Feb 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add unit tests for hashing, ID generation, and reranker utilities.
test_hash_utils.py(6 tests): coversget_hashdeterminism, known MD5 vector, uniqueness, unicode input, empty string, and 32-char hex output formattest_id_generator.py(22 tests): coverscreate_source_id,create_chunk_id,create_entity_id,create_topic_id,create_statement_id,create_fact_id,rewrite_id_for_tenant, and tenant isolation across all node types.test_reranker_utils.py(7 tests): coversto_floatnumpy scalar coercion andscore_values_with_tfidfreturn type, score ordering, and non-negative score guaranteesTest plan
PYTHONPATH=lexical-graph/src .venv/bin/python -m pytest lexical-graph/tests/unit/ -v— 73 tests pass across all phases