mirror of
https://github.com/microsoft/graphrag.git
synced 2026-02-07 19:52:44 +08:00
Deep copy txt units on local search to avoid race conditions (#1118)
* Deep copy txt units on local search to avoid race conditions * Format
This commit is contained in:
parent
e7ee8cb8a5
commit
cdf5fc4d67
@ -0,0 +1,4 @@
|
||||
{
|
||||
"type": "patch",
|
||||
"description": "Deep copy txt units on local search to avoid race conditions"
|
||||
}
|
||||
@ -3,6 +3,7 @@
|
||||
"""Algorithms to build context data for local search prompt."""
|
||||
|
||||
import logging
|
||||
from copy import deepcopy
|
||||
from typing import Any
|
||||
|
||||
import pandas as pd
|
||||
@ -319,7 +320,7 @@ class LocalSearchMixedContext(LocalContextBuilder):
|
||||
for text_id in entity.text_unit_ids or []:
|
||||
if text_id not in text_unit_ids_set and text_id in self.text_units:
|
||||
text_unit_ids_set.add(text_id)
|
||||
selected_unit = self.text_units[text_id]
|
||||
selected_unit = deepcopy(self.text_units[text_id])
|
||||
num_relationships = count_relationships(
|
||||
selected_unit, entity, self.relationships
|
||||
)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user