From 6b915012f1588e9afb667472b4d1bdbb75f1d4a2 Mon Sep 17 00:00:00 2001 From: Karen Chen <64801825+karenc-bq@users.noreply.github.com> Date: Thu, 3 Dec 2026 16:36:20 +0000 Subject: [PATCH] fix: cap sqlalchemy version below 2.1 --- docs/GettingStarted.md | 2 +- docs/using-the-python-wrapper/SqlAlchemySupport.md | 4 ++-- poetry.lock | 2 +- pyproject.toml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md index d908a78ef..6a8f1eba9 100644 --- a/docs/GettingStarted.md +++ b/docs/GettingStarted.md @@ -41,7 +41,7 @@ pip install aiomysql # MySQL async Some features pull in additional packages when used with the asyncio API: - The async Federated Authentication and Okta Authentication plugins use [aiohttp](https://docs.aiohttp.org/) for their HTTP flows: `pip install aiohttp`. -- Async SQLAlchemy (`create_async_engine`) requires SQLAlchemy's asyncio support, which includes `greenlet`: `pip install "sqlalchemy[asyncio]"`. +- Async SQLAlchemy (`create_async_engine`) requires SQLAlchemy's asyncio support, which includes `greenlet`: `pip install "sqlalchemy[asyncio]>=2.0.49,<2.1"`. SQLAlchemy 2.1 is not supported yet. ### Asyncio on Windows diff --git a/docs/using-the-python-wrapper/SqlAlchemySupport.md b/docs/using-the-python-wrapper/SqlAlchemySupport.md index 852ed4da0..9ca3d2aa7 100644 --- a/docs/using-the-python-wrapper/SqlAlchemySupport.md +++ b/docs/using-the-python-wrapper/SqlAlchemySupport.md @@ -5,7 +5,7 @@ The AWS Advanced Python Wrapper can be used as a PEP 249 DBAPI module with SQLAl ## Prerequisites - Python 3.10 – 3.14 (inclusive) -- SQLAlchemy 2.x +- SQLAlchemy 2.0, version 2.0.49 or later (`pip install "sqlalchemy>=2.0.49,<2.1"`); SQLAlchemy 2.1 is not supported yet - One of: - [psycopg v3](https://www.psycopg.org/psycopg3/) for PostgreSQL - [mysql-connector-python](https://dev.mysql.com/doc/connector-python/en/) for MySQL @@ -194,7 +194,7 @@ The KMS Encryption Plugin works with synchronous engines only, and its guide's [ ## Async usage > [!NOTE]\ -> Async engines require SQLAlchemy's asyncio support (`pip install "sqlalchemy[asyncio]"`, which includes `greenlet`), plus the async driver: Psycopg for PostgreSQL, [aiomysql](https://github.com/aio-libs/aiomysql) for MySQL. +> Async engines require SQLAlchemy's asyncio support (`pip install "sqlalchemy[asyncio]>=2.0.49,<2.1"`, which includes `greenlet`), plus the async driver: Psycopg for PostgreSQL, [aiomysql](https://github.com/aio-libs/aiomysql) for MySQL. > [!IMPORTANT]\ > **On Windows**, select a selector event loop before running any async code, or every diff --git a/poetry.lock b/poetry.lock index 96f9735c4..43552cb48 100644 --- a/poetry.lock +++ b/poetry.lock @@ -4622,4 +4622,4 @@ encryption = ["cryptography", "sqlglot"] [metadata] lock-version = "2.1" python-versions = "^3.10.0" -content-hash = "4e1baf46a2db5efc526ef39031bb861db959116cb2f8124f40b222ff39d39b67" +content-hash = "2df3e498568c61e2e00a55f26034e058b2f241490e2cef2be74437d3d2c46480" diff --git a/pyproject.toml b/pyproject.toml index 8cdc18c8e..02d859e4e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -69,7 +69,7 @@ flake8 = ">=7.3.0,<8" flake8-type-checking = ">=3.2.0,<4.0" isort = "^9.0.2" pep8-naming = ">=0.15.1,<0.16.0" -SQLAlchemy = "^2.0.49" +SQLAlchemy = ">=2.0.49,<2.1" psycopg = "^3.3.3" psycopg-binary = "^3.3.3" mysql-connector-python = "^9.7.0"