From 97eb29b6ebcb17d208a3815fded74ecb344513f5 Mon Sep 17 00:00:00 2001 From: Arnav Date: Thu, 16 Jul 2026 22:06:55 +0530 Subject: [PATCH] [v3-3-test] Relax aiosqlite cap. Support `aiosqlite>=0.20.0` (#69796) aiosqlite 0.22.0 had a hanging pytest session bug (aiosqlite#369) and also triggered a hanging helper thread under SQLAlchemy 2 (sqlalchemy#13039). The pytest issue was fixed in 0.22.1, and the SQLAlchemy-side fix shipped in 2.0.46. Since our SQLAlchemy floor is already >=2.0.48, we can safely relax the cap from <0.22.0 to !=0.22.0 (excluding only the known-bad 0.22.0 release). Part of #69616. (cherry picked from commit f201f14498732074047c6e8cdd45b8d3f197633e) Co-authored-by: Arnav --- airflow-core/pyproject.toml | 8 +++----- uv.lock | 11 ++++------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/airflow-core/pyproject.toml b/airflow-core/pyproject.toml index 1a068ac63ca32..f6e3d8221d87e 100644 --- a/airflow-core/pyproject.toml +++ b/airflow-core/pyproject.toml @@ -71,11 +71,9 @@ dependencies = [ "cachetools>=6.0.0", # aiosqlite 0.22.0 has a problem with hanging pytest sessions and we excluded it # See https://github.com/omnilib/aiosqlite/issues/369 - # It seems that while our test issues are fixed in 0.22.1, sqlalchemy 2 itself - # is not compatible with it and leaves thread hanging This is already fixed in main of sqlalchemy - # But not released yet - and we will likely have to add >=2.0.46+ for sqlalchemy when released to - # protect against it https://github.com/sqlalchemy/sqlalchemy/issues/13039 - "aiosqlite>=0.20.0,<0.22.0", + # The thread hanging issue under SQLAlchemy 2 (sqlalchemy#13039) is resolved in + # SQLAlchemy 2.0.46+. Since our SQLAlchemy floor is >=2.0.48, we can safely allow 0.22.1+. + "aiosqlite>=0.20.0,!=0.22.0", # Alembic is important to handle our migrations in predictable and performant way. It is developed # together with SQLAlchemy. Our experience with Alembic is that it very stable in minor version # The 1.13.0 of alembic marked some migration code as SQLAlchemy 2+ only so we limit it to 1.13.1 diff --git a/uv.lock b/uv.lock index 709e8ee883e4d..9dd8eeaa9bae5 100644 --- a/uv.lock +++ b/uv.lock @@ -694,14 +694,11 @@ wheels = [ [[package]] name = "aiosqlite" -version = "0.21.0" +version = "0.22.1" source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "typing-extensions" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/13/7d/8bca2bf9a247c2c5dfeec1d7a5f40db6518f88d314b8bca9da29670d2671/aiosqlite-0.21.0.tar.gz", hash = "sha256:131bb8056daa3bc875608c631c678cda73922a2d4ba8aec373b19f18c17e7aa3", size = 13454, upload-time = "2025-02-03T07:30:16.235Z" } +sdist = { url = "https://files.pythonhosted.org/packages/4e/8a/64761f4005f17809769d23e518d915db74e6310474e733e3593cfc854ef1/aiosqlite-0.22.1.tar.gz", hash = "sha256:043e0bd78d32888c0a9ca90fc788b38796843360c855a7262a532813133a0650", size = 14821, upload-time = "2025-12-23T19:25:43.997Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/f5/10/6c25ed6de94c49f88a91fa5018cb4c0f3625f31d5be9f771ebe5cc7cd506/aiosqlite-0.21.0-py3-none-any.whl", hash = "sha256:2549cf4057f95f53dcba16f2b64e8e2791d7e1adedb13197dd8ed77bb226d7d0", size = 15792, upload-time = "2025-02-03T07:30:13.6Z" }, + { url = "https://files.pythonhosted.org/packages/00/b7/e3bf5133d697a08128598c8d0abc5e16377b51465a33756de24fa7dee953/aiosqlite-0.22.1-py3-none-any.whl", hash = "sha256:21c002eb13823fad740196c5a2e9d8e62f6243bd9e7e4a1f87fb5e44ecb4fceb", size = 17405, upload-time = "2025-12-23T19:25:42.139Z" }, ] [[package]] @@ -2042,7 +2039,7 @@ mypy = [ [package.metadata] requires-dist = [ { name = "a2wsgi", specifier = ">=1.10.8" }, - { name = "aiosqlite", specifier = ">=0.20.0,<0.22.0" }, + { name = "aiosqlite", specifier = ">=0.20.0,!=0.22.0" }, { name = "alembic", specifier = ">=1.13.1,<2.0" }, { name = "apache-airflow-core", extras = ["graphviz", "gunicorn", "kerberos", "otel", "statsd"], marker = "extra == 'all'", editable = "airflow-core" }, { name = "apache-airflow-providers-common-compat", editable = "providers/common/compat" },