rusackas opened a new pull request, #42866: URL: https://github.com/apache/superset/pull/42866
### SUMMARY `TestDatasource.setUp` (`tests/integration_tests/datasource_tests.py`) 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: scoped_session.begin() got an unexpected keyword argument 'subtransactions'`). It surfaced while investigating discussion #40273's SQLAlchemy 2.0 bump, but it's a standalone fix independent of that work — `Session` autobegins on first use under both 1.4 and 2.0, so the explicit `begin()` call is unnecessary either way, and `tearDown`'s `rollback()` still correctly discards whatever the test did without it. ### TESTING INSTRUCTIONS Ran the full file locally against sqlite (with Redis up for the two cache-dependent tests): ``` pytest tests/integration_tests/datasource_tests.py -v # 31 passed ``` ### ADDITIONAL INFORMATION - [ ] Has associated issue: - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration - [ ] Introduces new feature or API - [ ] Removes existing feature or API -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
