Skip to content

Commit

Permalink
chore: PgVector - remove legacy filter support (#1068)
Browse files Browse the repository at this point in the history
* Remove legacy filter support

* Linting

* Error msg fmt
  • Loading branch information
vblagoje authored and Amnah199 committed Oct 2, 2024
1 parent 89008be commit f6bee4a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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))

Expand Down

0 comments on commit f6bee4a

Please sign in to comment.