From 9db868f0afccd5a72a9e5ad9fe3026be8500cf34 Mon Sep 17 00:00:00 2001 From: Claude Code Date: Thu, 6 Aug 2026 15:03:00 -0700 Subject: [PATCH] fix(tests): drop removed subtransactions= kwarg from Session.begin() TestDatasource.setUp explicitly opened a transaction with db.session.begin(subtransactions=True) before each test, relying on tearDown's rollback() to isolate them. subtransactions was already deprecated in SQLAlchemy 1.4 and is removed outright in 2.0 (TypeError: unexpected keyword argument 'subtransactions'), surfacing as a failure while investigating discussion #40273's SQLAlchemy 2.0 bump. The explicit begin() is unnecessary either way: Session autobegins on first use under both 1.4 and 2.0, so tearDown's rollback() still correctly discards whatever the test did without it. --- tests/integration_tests/datasource_tests.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/integration_tests/datasource_tests.py b/tests/integration_tests/datasource_tests.py index 407bbfddb768..d75e517001a8 100644 --- a/tests/integration_tests/datasource_tests.py +++ b/tests/integration_tests/datasource_tests.py @@ -107,9 +107,6 @@ def create_and_cleanup_table(table=None): class TestDatasource(SupersetTestCase): - def setUp(self): - db.session.begin(subtransactions=True) - def tearDown(self): db.session.rollback() super().tearDown()