From f6bee4a5ac014383080fb3a8adb47352719908be Mon Sep 17 00:00:00 2001 From: Vladimir Blagojevic Date: Thu, 12 Sep 2024 14:59:24 +0200 Subject: [PATCH] chore: PgVector - remove legacy filter support (#1068) * Remove legacy filter support * Linting * Error msg fmt --- .../document_stores/pgvector/document_store.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/integrations/pgvector/src/haystack_integrations/document_stores/pgvector/document_store.py b/integrations/pgvector/src/haystack_integrations/document_stores/pgvector/document_store.py index ae4878aba..a02c46200 100644 --- a/integrations/pgvector/src/haystack_integrations/document_stores/pgvector/document_store.py +++ b/integrations/pgvector/src/haystack_integrations/document_stores/pgvector/document_store.py @@ -9,7 +9,6 @@ from haystack.document_stores.errors import DocumentStoreError, DuplicateDocumentError from haystack.document_stores.types import DuplicatePolicy from haystack.utils.auth import Secret, deserialize_secrets_inplace -from haystack.utils.filters import convert from psycopg import Error, IntegrityError, connect from psycopg.abc import Query from psycopg.cursor import Cursor @@ -389,7 +388,8 @@ def filter_documents(self, filters: Optional[Dict[str, Any]] = None) -> List[Doc msg = "Filters must be a dictionary" raise TypeError(msg) if "operator" not in filters and "conditions" not in filters: - filters = convert(filters) + msg = "Invalid filter syntax. See https://docs.haystack.deepset.ai/docs/metadata-filtering for details." + raise ValueError(msg) sql_filter = SQL("SELECT * FROM {table_name}").format(table_name=Identifier(self.table_name))