Use namespace for graph_name before falling back to env or default value

- Update graph_name initialization
- Add namespace override support
- Maintain backward compatibility
- Prioritize namespace over env variable
This commit is contained in:
yangdx
2025-02-13 04:52:54 +08:00
parent ed73ea4076
commit 76164a1b17

View File

@@ -587,7 +587,7 @@ class PGGraphStorage(BaseGraphStorage):
print("no preloading of graph with AGE in production")
def __post_init__(self):
self.graph_name = os.environ.get("AGE_GRAPH_NAME", "lightrag")
self.graph_name = self.namespace or os.environ.get("AGE_GRAPH_NAME", "lightrag")
self._node_embed_algorithms = {
"node2vec": self._node2vec_embed,
}