Skip to content

Commit e72f740

Browse files
chore: Add deprecation warning for PGVector (#169)
Co-authored-by: Averi Kitsch <[email protected]>
1 parent 016f1a3 commit e72f740

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

langchain_postgres/vectorstores.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
Type,
2020
Union,
2121
)
22+
import warnings
2223
from typing import (
2324
cast as typing_cast,
2425
)
@@ -48,6 +49,8 @@
4849

4950
from langchain_postgres._utils import maximal_marginal_relevance
5051

52+
warnings.simplefilter("once", PendingDeprecationWarning)
53+
5154

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

434+
warnings.warn(
435+
"PGVector is being deprecated and will be removed in the future. "
436+
"Please migrate to PGVectorStore. "
437+
"Refer to the migration guide at [https://github.com/langchain-ai/langchain-postgres/blob/main/examples/migrate_pgvector_to_pgvectorstore.md] for details.",
438+
PendingDeprecationWarning,
439+
)
440+
431441
if isinstance(connection, str):
432442
if async_mode:
433443
self._async_engine = create_async_engine(

0 commit comments

Comments
 (0)