Skip to content

Commit 1ab0968

Browse files
committed
🎨 [Improvement] improve test percentage
1 parent 662596f commit 1ab0968

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

‎backend/utils/document_vector_utils.py‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,14 @@ def union(x, y):
324324
union(doc_id1, doc_id2)
325325

326326
# Group documents by their root parent
327+
# Only include documents that are part of duplicate pairs
328+
duplicate_doc_ids = set()
329+
for doc_id1, doc_id2, _, _, _ in merged_pairs:
330+
duplicate_doc_ids.add(doc_id1)
331+
duplicate_doc_ids.add(doc_id2)
332+
327333
groups = {}
328-
for doc_id in doc_embeddings.keys():
334+
for doc_id in duplicate_doc_ids:
329335
root = find(doc_id)
330336
if root not in groups:
331337
groups[root] = []

0 commit comments

Comments
 (0)