From 2c0c9cd730b28587b10aca2db99573722b66db4e Mon Sep 17 00:00:00 2001 From: Mohammad Amin Dadgar <48308230+amindadgar@users.noreply.github.com> Date: Tue, 12 Mar 2024 11:46:17 +0330 Subject: [PATCH 1/3] Update settings.py - Adding the executemany_mode support of sqlalchemy==2.0.0 --- airflow/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airflow/settings.py b/airflow/settings.py index 6cbf6126e09dc8..7a673b84fc243a 100644 --- a/airflow/settings.py +++ b/airflow/settings.py @@ -273,7 +273,7 @@ def configure_orm(disable_connection_pool=False, pool_class=None): DEFAULT_ENGINE_ARGS = { "postgresql": { - "executemany_mode": "values", + "executemany_mode": "values_only", "executemany_values_page_size": 10000, "executemany_batch_page_size": 2000, }, From 21e23ccfaef5ac959f0048a2b3ebc05eeed00432 Mon Sep 17 00:00:00 2001 From: Mohammad Amin Dadgar <48308230+amindadgar@users.noreply.github.com> Date: Tue, 12 Mar 2024 11:48:15 +0330 Subject: [PATCH 2/3] Update pyproject.toml sqlalchemy dependency version update. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index a68b47c4be48a0..1bd4c79604d754 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -137,7 +137,7 @@ dependencies = [ # See https://sqlalche.me/e/b8d9 for details of deprecated features # you can set environment variable SQLALCHEMY_WARN_20=1 to show all deprecation warnings. # The issue tracking it is https://github.com/apache/airflow/issues/28723 - "sqlalchemy>=1.4.36,<2.0", + "sqlalchemy>=1.4.36,<=2.0", "sqlalchemy-jsonfield>=1.0", "tabulate>=0.7.5", "tenacity>=6.2.0,!=8.2.0", From 6e13ee3536e2238d603a693559f4caa8d3c0fdf3 Mon Sep 17 00:00:00 2001 From: Mohammad Amin Dadgar <48308230+amindadgar@users.noreply.github.com> Date: Tue, 12 Mar 2024 12:09:44 +0330 Subject: [PATCH 3/3] Added support for sqlalchemy versions bigger than 2.0.0 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 1bd4c79604d754..342aa03cf5b2bc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -137,7 +137,7 @@ dependencies = [ # See https://sqlalche.me/e/b8d9 for details of deprecated features # you can set environment variable SQLALCHEMY_WARN_20=1 to show all deprecation warnings. # The issue tracking it is https://github.com/apache/airflow/issues/28723 - "sqlalchemy>=1.4.36,<=2.0", + "sqlalchemy>=2.0.0,<2.1.0", "sqlalchemy-jsonfield>=1.0", "tabulate>=0.7.5", "tenacity>=6.2.0,!=8.2.0",