From 75de7993531cb5f55d8532143e630dc265ba5ebd Mon Sep 17 00:00:00 2001 From: yangdx Date: Wed, 30 Jul 2025 01:00:06 +0800 Subject: [PATCH] Remove deprecated content field from doc status storage - Remove content field from JSON storage - Remove content field from MongoDB storage - Remove content field from Redis storage --- lightrag/kg/json_doc_status_impl.py | 4 ++++ lightrag/kg/mongo_impl.py | 4 ++++ lightrag/kg/redis_impl.py | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/lightrag/kg/json_doc_status_impl.py b/lightrag/kg/json_doc_status_impl.py index aecb8713..404dc260 100644 --- a/lightrag/kg/json_doc_status_impl.py +++ b/lightrag/kg/json_doc_status_impl.py @@ -95,6 +95,8 @@ class JsonDocStatusStorage(DocStatusStorage): try: # Make a copy of the data to avoid modifying the original data = v.copy() + # Remove deprecated content field if it exists + data.pop("content", None) # If file_path is not in data, use document id as file path if "file_path" not in data: data["file_path"] = "no-file-path" @@ -120,6 +122,8 @@ class JsonDocStatusStorage(DocStatusStorage): try: # Make a copy of the data to avoid modifying the original data = v.copy() + # Remove deprecated content field if it exists + data.pop("content", None) # If file_path is not in data, use document id as file path if "file_path" not in data: data["file_path"] = "no-file-path" diff --git a/lightrag/kg/mongo_impl.py b/lightrag/kg/mongo_impl.py index f15576a9..1f9ce5e1 100644 --- a/lightrag/kg/mongo_impl.py +++ b/lightrag/kg/mongo_impl.py @@ -381,6 +381,8 @@ class MongoDocStatusStorage(DocStatusStorage): try: # Make a copy of the data to avoid modifying the original data = doc.copy() + # Remove deprecated content field if it exists + data.pop("content", None) # If file_path is not in data, use document id as file path if "file_path" not in data: data["file_path"] = "no-file-path" @@ -406,6 +408,8 @@ class MongoDocStatusStorage(DocStatusStorage): try: # Make a copy of the data to avoid modifying the original data = doc.copy() + # Remove deprecated content field if it exists + data.pop("content", None) # If file_path is not in data, use document id as file path if "file_path" not in data: data["file_path"] = "no-file-path" diff --git a/lightrag/kg/redis_impl.py b/lightrag/kg/redis_impl.py index e5a59c80..536f1a85 100644 --- a/lightrag/kg/redis_impl.py +++ b/lightrag/kg/redis_impl.py @@ -786,6 +786,8 @@ class RedisDocStatusStorage(DocStatusStorage): # Make a copy of the data to avoid modifying the original data = doc_data.copy() + # Remove deprecated content field if it exists + data.pop("content", None) # If file_path is not in data, use document id as file path if "file_path" not in data: data["file_path"] = "no-file-path" @@ -840,6 +842,8 @@ class RedisDocStatusStorage(DocStatusStorage): # Make a copy of the data to avoid modifying the original data = doc_data.copy() + # Remove deprecated content field if it exists + data.pop("content", None) # If file_path is not in data, use document id as file path if "file_path" not in data: data["file_path"] = "no-file-path"