From 0853d60f16b45472ebac83bcb4fb6de112c90d6b Mon Sep 17 00:00:00 2001 From: Jarek Potiuk Date: Tue, 5 Jul 2022 11:13:50 +0200 Subject: [PATCH] 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. --- 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 754cb00271078..a5b52a7766711 100644 --- a/setup.cfg +++ b/setup.cfg @@ -142,11 +142,7 @@ install_requires = rich>=12.4.4 rich-click>=1.3.1 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 b6fe56b2d7795..1cba49b4c77ef 100644 --- a/tests/utils/test_db.py +++ b/tests/utils/test_db.py @@ -73,6 +73,9 @@ def test_database_schema_and_sqlalchemy_model_are_in_sync(self): 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'),