Skip to content

Commit

Permalink
Re-add Support for SQLAlchemy <1.4
Browse files Browse the repository at this point in the history
Support for SQLAlchemy 1.3 was removed in version 0.0.203 by change langchain-ai#6086. Re-adding support.
  • Loading branch information
bradcrossen authored Jun 29, 2023
1 parent 57f370c commit 5169be9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion langchain/vectorstores/analyticdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

from sqlalchemy import REAL, Column, String, Table, create_engine, insert, text
from sqlalchemy.dialects.postgresql import ARRAY, JSON, TEXT
from sqlalchemy.engine import Row

try:
from sqlalchemy.orm import declarative_base
Expand Down Expand Up @@ -59,6 +58,14 @@ def __init__(
self.logger = logger or logging.getLogger(__name__)
self.__post_init__()

try:
from sqlalchemy.engine import Row
except ImportError:
raise ImportError(
"Could not import Row from sqlalchemy.engine. "
"Please 'pip install sqlalchemy>=1.4'."
)

def __post_init__(
self,
) -> None:
Expand Down

0 comments on commit 5169be9

Please sign in to comment.