From 41ade0a36ab3c8e22804ed47287957e3be889385 Mon Sep 17 00:00:00 2001 From: Elena Kolevska Date: Thu, 17 Apr 2025 11:02:17 +0300 Subject: [PATCH 1/2] Marks old RediSearch 1.0 commands as deprecated --- redis/commands/search/commands.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/redis/commands/search/commands.py b/redis/commands/search/commands.py index 42866f5ec1..854c8161be 100644 --- a/redis/commands/search/commands.py +++ b/redis/commands/search/commands.py @@ -23,7 +23,6 @@ SEARCH_CMD = "FT.SEARCH" ADD_CMD = "FT.ADD" ADDHASH_CMD = "FT.ADDHASH" -DROP_CMD = "FT.DROP" DROPINDEX_CMD = "FT.DROPINDEX" EXPLAIN_CMD = "FT.EXPLAIN" EXPLAINCLI_CMD = "FT.EXPLAINCLI" @@ -35,7 +34,6 @@ DICT_ADD_CMD = "FT.DICTADD" DICT_DEL_CMD = "FT.DICTDEL" DICT_DUMP_CMD = "FT.DICTDUMP" -GET_CMD = "FT.GET" MGET_CMD = "FT.MGET" CONFIG_CMD = "FT.CONFIG" TAGVALS_CMD = "FT.TAGVALS" @@ -406,6 +404,9 @@ def add_document_hash(self, doc_id, score=1.0, language=None, replace=False): doc_id, conn=None, score=score, language=language, replace=replace ) + @deprecated_function( + version="2.0.0", reason="deprecated since redisearch 2.0" + ) def delete_document(self, doc_id, conn=None, delete_actual_document=False): """ Delete a document from index @@ -440,6 +441,9 @@ def load_document(self, id): return Document(id=id, **fields) + @deprecated_function( + version="2.0.0", reason="deprecated since redisearch 2.0" + ) def get(self, *ids): """ Returns the full contents of multiple documents. From 5989a561ef245e0f40ed7ec8b8ce1e617a529201 Mon Sep 17 00:00:00 2001 From: Elena Kolevska Date: Thu, 17 Apr 2025 17:05:47 +0300 Subject: [PATCH 2/2] linters --- redis/commands/search/commands.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/redis/commands/search/commands.py b/redis/commands/search/commands.py index 854c8161be..bc48fa9aa8 100644 --- a/redis/commands/search/commands.py +++ b/redis/commands/search/commands.py @@ -404,9 +404,7 @@ def add_document_hash(self, doc_id, score=1.0, language=None, replace=False): doc_id, conn=None, score=score, language=language, replace=replace ) - @deprecated_function( - version="2.0.0", reason="deprecated since redisearch 2.0" - ) + @deprecated_function(version="2.0.0", reason="deprecated since redisearch 2.0") def delete_document(self, doc_id, conn=None, delete_actual_document=False): """ Delete a document from index @@ -441,9 +439,7 @@ def load_document(self, id): return Document(id=id, **fields) - @deprecated_function( - version="2.0.0", reason="deprecated since redisearch 2.0" - ) + @deprecated_function(version="2.0.0", reason="deprecated since redisearch 2.0") def get(self, *ids): """ Returns the full contents of multiple documents.