From 7faa370f65f2f1dd73d3fac0527e1705073f3d53 Mon Sep 17 00:00:00 2001 From: Jarek Potiuk Date: Sat, 19 Jul 2025 15:03:11 +0200 Subject: [PATCH] Add sql extras to pandas in the providers where sqlalchemy is needed Without those extras pandas does not impose limitations on sqlalchemy version used - but it is really an implicit dependency of pandas, when it is used for sqlalchemy interactions. This will drop constraint version of pandas for Airflow 3 to 2.1 and it is really a conflicting dependency for Python 3.13 where only pandas 2.2.3 can be used but it requires sqlalchemy 2. This extra should be added while migrating to sqlalchemy 2 is complete. --- providers/common/sql/pyproject.toml | 4 +++- providers/presto/pyproject.toml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/providers/common/sql/pyproject.toml b/providers/common/sql/pyproject.toml index d55b6c47282c4..b3b9569734494 100644 --- a/providers/common/sql/pyproject.toml +++ b/providers/common/sql/pyproject.toml @@ -69,7 +69,9 @@ dependencies = [ # Any change in the dependencies is preserved when the file is regenerated [project.optional-dependencies] "pandas" = [ - 'pandas>=2.1.2; python_version <"3.13"', + 'pandas[sql-other]>=2.1.2; python_version <"3.13"', + # Technically - we should add "sql-other" here as well, but this will only be possible when we move + # to sqlalchemy 2+ TODO(potiuk): do so. 'pandas>=2.2.3; python_version >="3.13"', ] "openlineage" = [ diff --git a/providers/presto/pyproject.toml b/providers/presto/pyproject.toml index 3abdbf8204778..269c57b127c99 100644 --- a/providers/presto/pyproject.toml +++ b/providers/presto/pyproject.toml @@ -60,7 +60,7 @@ dependencies = [ "apache-airflow>=2.10.0", "apache-airflow-providers-common-sql>=1.26.0", "presto-python-client>=0.8.4", - 'pandas>=2.1.2; python_version <"3.13"', + 'pandas[postgres]>=2.1.2; python_version <"3.13"', 'pandas>=2.2.3; python_version >="3.13"', ]