From 96451c5830cc308cc3bb2306e7bb7a39ac9513b7 Mon Sep 17 00:00:00 2001 From: estelle Date: Wed, 4 Dec 2024 09:56:03 +0100 Subject: [PATCH] Address comments --- CHANGELOG.md | 2 +- src/neo4j_graphrag/experimental/components/lexical_graph.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23260edf..1753a07b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ## Next ### Fixed -- IDs for the Document and Chunk nodes in the lexical graph are now randomly generated and unique across multiple runs, fixing issues in the lexical graph where relationships where created between chunks that were created by different pipeline runs. +- IDs for the Document and Chunk nodes in the lexical graph are now randomly generated and unique across multiple runs, fixing issues in the lexical graph where relationships were created between chunks that were created by different pipeline runs. ### Changed - The `id_prefix` parameter in the `LexicalGraphConfig` is deprecated. diff --git a/src/neo4j_graphrag/experimental/components/lexical_graph.py b/src/neo4j_graphrag/experimental/components/lexical_graph.py index 90135a31..bbe99b80 100644 --- a/src/neo4j_graphrag/experimental/components/lexical_graph.py +++ b/src/neo4j_graphrag/experimental/components/lexical_graph.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. import asyncio +import datetime import logging -from datetime import datetime from itertools import zip_longest from typing import Any, Dict, Optional @@ -112,7 +112,7 @@ def create_document_node(self, document_info: DocumentInfo) -> Neo4jNode: label=self.config.document_node_label, properties={ "path": document_info.path, - "createdAt": str(datetime.now()), + "createdAt": datetime.datetime.now(datetime.timezone.utc).isoformat(), **document_metadata, }, )