Title: [sqlalchemy-spanner] Compliance test and migration test failures with Alembic 1.20 and SQLAlchemy 2.1 · Issue #18580 · googleapis/google-cloud-python · GitHub
Open Graph Title: [sqlalchemy-spanner] Compliance test and migration test failures with Alembic 1.20 and SQLAlchemy 2.1 · Issue #18580 · googleapis/google-cloud-python
X Title: [sqlalchemy-spanner] Compliance test and migration test failures with Alembic 1.20 and SQLAlchemy 2.1 · Issue #18580 · googleapis/google-cloud-python
Description: Description Recent upstream releases of Alembic (1.20.0) and SQLAlchemy (2.1.3) introduced several breaking changes and test failures in the sqlalchemy-spanner package: 1. Alembic 1.20+ / SQLAlchemy 1.4 Version Conflict alembic>=1.20.0 d...
Open Graph Description: Description Recent upstream releases of Alembic (1.20.0) and SQLAlchemy (2.1.3) introduced several breaking changes and test failures in the sqlalchemy-spanner package: 1. Alembic 1.20+ / SQLAlchem...
X Description: Description Recent upstream releases of Alembic (1.20.0) and SQLAlchemy (2.1.3) introduced several breaking changes and test failures in the sqlalchemy-spanner package: 1. Alembic 1.20+ / SQLAlchem...
Opengraph URL: https://github.com/googleapis/google-cloud-python/issues/18580
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[sqlalchemy-spanner] Compliance test and migration test failures with Alembic 1.20 and SQLAlchemy 2.1","articleBody":"## Description\n\nRecent upstream releases of **Alembic (`1.20.0`)** and **SQLAlchemy (`2.1.3`)** introduced several breaking changes and test failures in the `sqlalchemy-spanner` package:\n\n### 1. Alembic 1.20+ / SQLAlchemy 1.4 Version Conflict\n`alembic>=1.20.0` dropped support for SQLAlchemy 1.4 and now requires `sqlalchemy>=2.0`. In the `compliance_test_14` Nox session, installing `.[tracing]` resolved Alembic 1.20 before force-reinstalling `sqlalchemy\u003c2.0`, resulting in a runtime `ImportError`:\n```text\nImportError: cannot import name '_NoneName' from 'sqlalchemy.sql.base'\n```\n\n### 2. Missing Optional Dependency Guard for Alembic\nThe Spanner dialect (`google/cloud/sqlalchemy_spanner/sqlalchemy_spanner.py`) previously imported `from alembic.ddl.base import ...` unconditionally at the top level. Users who only use SQLAlchemy Core or ORM (without Alembic installed or in environments with mismatched versions) could not import the dialect.\n\n### 3. SQLAlchemy 2.1 Compliance Test Suite Breakages\nIn `tests/test_suite_20.py`:\n- **Missing `test_deprecations`**: Upstream SQLAlchemy 2.1 removed `sqlalchemy.testing.suite.test_deprecations`, causing `ModuleNotFoundError` during pytest collection.\n- **`types.Float` MRO Decoupling**: Upstream decoupled `types.Float` from `types.Numeric` (it now inherits from `NumericCommon`), causing `ComponentReflectionTest.test_get_columns` intersection checks to fail.\n- **Cross-Schema Reflection**: Upstream added `HasTableTest.test_has_multi_table_schema`. GoogleSQL Cloud Spanner does not support user-defined schema namespaces (`TABLE_SCHEMA = ''`).\n- **JSON Cross-Casts**: Upstream added `JSONTest.test_index_cross_casts`. Spanner's `JSON_VALUE()` always returns `STRING`, which causes type assertions (`isinstance(roundtrip, bool)`) to fail.\n\n### 4. Migration Test Matrix Gaps\nThe `migration_test` session in `noxfile.py` did not explicitly parametrize both supported SQLAlchemy versions (1.4 and 2.0+), leaving migration workflows vulnerable to dependency drift.\n\n---\n\n## Proposed Resolution\n\nAddressed in PR: https://github.com/googleapis/google-cloud-python/pull/18570\n","author":{"url":"https://github.com/chalmerlowe","@type":"Person","name":"chalmerlowe"},"datePublished":"2026-10-06T11:14:41Z","url":"https://github.com/googleapis/google-cloud-python/issues/18580"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:73e301ae-2238-1de8-ee35-c2217f554563 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B194:264CD6:8A574D:B689D3:6AFE7A42 |
| html-safe-nonce | ada38decb4c0efb329e8d20b92ecfd53ee72cc0140022040353ca5d36525c542 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMTk0OjI2NENENjo4QTU3NEQ6QjY4OUQzOjZBRkU3QTQyIiwidmlzaXRvcl9pZCI6IjE2NTcwNTYyMzM1MDYzNzIxNjIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 2d0eaf5f2d94f5219b76b592703d6b8ae98356b2a15b208bdbb5d71f2b68b6c6 |
| hovercard-subject-tag | issue:5727428417 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/googleapis/google-cloud-python/18580/issue_layout |
| twitter:image | https://opengraph.githubassets.com/cb0b8c0e052c9f8acb3d17fbb03620fd1e7473871bbbdc8f4b3d82befb5dd27f/googleapis/google-cloud-python/issues/18580 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/cb0b8c0e052c9f8acb3d17fbb03620fd1e7473871bbbdc8f4b3d82befb5dd27f/googleapis/google-cloud-python/issues/18580 |
| og:image:alt | Description Recent upstream releases of Alembic (1.20.0) and SQLAlchemy (2.1.3) introduced several breaking changes and test failures in the sqlalchemy-spanner package: 1. Alembic 1.20+ / SQLAlchem... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | chalmerlowe |
| hostname | github.com |
| expected-hostname | github.com |
| None | b3c0f155eafc27e60db6e254d1ffff0e072e9ab3b4018a5ee518797c19d89f86 |
| turbo-cache-control | no-preview |
| go-import | github.com/googleapis/google-cloud-python git https://github.com/googleapis/google-cloud-python.git |
| octolytics-dimension-user_id | 16785467 |
| octolytics-dimension-user_login | googleapis |
| octolytics-dimension-repository_id | 16316451 |
| octolytics-dimension-repository_nwo | googleapis/google-cloud-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 16316451 |
| octolytics-dimension-repository_network_root_nwo | googleapis/google-cloud-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4a10310af51a1bfffbedc4fd81cb582acf0cb0ff |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width