You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2022/07/05 12:24:10 UTC

[airflow] 04/04: Remove upper-binding for SQLAlchemy (#24819)

This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch v2-3-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 069a84c4adffbe4c32eb8096a183fd0c53f2bafe
Author: Jarek Potiuk <ja...@polidea.com>
AuthorDate: Tue Jul 5 11:13:50 2022 +0200

    Remove upper-binding for SQLAlchemy (#24819)
    
    There was a problem with custom classes for SQLAlchemy that
    prevented it to work on MySQL. This PR removes the SQLAlchemy
    upper binding.
    
    This has been added as an issue in:
    
    https://github.com/sqlalchemy/sqlalchemy/issues/7660
    
    But apparently it's been fixed in one of the more recent SQLAlchemy
    releases.
    
    (cherry picked from commit 0853d60f16b45472ebac83bcb4fb6de112c90d6b)
---
 setup.cfg              | 6 +-----
 tests/utils/test_db.py | 3 +++
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/setup.cfg b/setup.cfg
index 323e21b234..0e1e9f7b84 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -141,11 +141,7 @@ install_requires =
     python-slugify>=5.0
     rich>=12.4.4
     setproctitle>=1.1.8
-    # SQL Alchemy 1.4.10 introduces a bug where for PyODBC driver UTCDateTime fields get wrongly converted
-    # as string and fail to be converted back to datetime. It was supposed to be fixed in
-    # https://github.com/sqlalchemy/sqlalchemy/issues/6366 (released in 1.4.12) but apparently our case
-    # is different. Opened https://github.com/sqlalchemy/sqlalchemy/issues/7660 to track it
-    sqlalchemy>=1.4,<1.4.10
+    sqlalchemy>=1.4
     sqlalchemy_jsonfield>=1.0
     tabulate>=0.7.5
     tenacity>=6.2.0
diff --git a/tests/utils/test_db.py b/tests/utils/test_db.py
index 752f9873aa..7340bc40cb 100644
--- a/tests/utils/test_db.py
+++ b/tests/utils/test_db.py
@@ -62,6 +62,9 @@ class TestDb:
             lambda t: (t[0] == 'remove_table' and t[1].name == 'spt_fallback_usg'),
             lambda t: (t[0] == 'remove_table' and t[1].name == 'MSreplication_options'),
             lambda t: (t[0] == 'remove_table' and t[1].name == 'spt_fallback_dev'),
+            # MSSQL foreign keys where CASCADE has been removed
+            lambda t: (t[0] == 'remove_fk' and t[1].name == 'task_reschedule_dr_fkey'),
+            lambda t: (t[0] == 'add_fk' and t[1].name == 'task_reschedule_dr_fkey'),
             # Ignore flask-session table/index
             lambda t: (t[0] == 'remove_table' and t[1].name == 'session'),
             lambda t: (t[0] == 'remove_index' and t[1].name == 'session_id'),