Skip to content

chore: Add deprecation warning for PGVector #169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions langchain_postgres/vectorstores.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
Type,
Union,
)
import warnings
from typing import (
cast as typing_cast,
)
Expand Down Expand Up @@ -48,6 +49,8 @@

from langchain_postgres._utils import maximal_marginal_relevance

warnings.simplefilter("once", PendingDeprecationWarning)


class DistanceStrategy(str, enum.Enum):
"""Enumerator of the Distance strategies."""
Expand Down Expand Up @@ -428,6 +431,13 @@ def __init__(
self._async_engine: Optional[AsyncEngine] = None
self._async_init = False

warnings.warn(
"PGVector is being deprecated and will be removed in the future. "
"Please migrate to PGVectorStore. "
"Refer to the migration guide at [https://github.com/langchain-ai/langchain-postgres/blob/main/examples/migrate_pgvector_to_pgvectorstore.md] for details.",
PendingDeprecationWarning,
)

if isinstance(connection, str):
if async_mode:
self._async_engine = create_async_engine(
Expand Down