Title: Compliance Test Failures in SQLAlchemy Spanner Dialect · Issue #805 · googleapis/python-spanner-sqlalchemy · GitHub
Open Graph Title: Compliance Test Failures in SQLAlchemy Spanner Dialect · Issue #805 · googleapis/python-spanner-sqlalchemy
X Title: Compliance Test Failures in SQLAlchemy Spanner Dialect · Issue #805 · googleapis/python-spanner-sqlalchemy
Description: Observed Behavior: The compliance_test_20 test suite for the SQLAlchemy Spanner dialect is failing on Python 3.13 and 3.14. The failures occur in tests related to schema reflection, specifically with identifiers that are quoted, contain ...
Open Graph Description: Observed Behavior: The compliance_test_20 test suite for the SQLAlchemy Spanner dialect is failing on Python 3.13 and 3.14. The failures occur in tests related to schema reflection, specifically wi...
X Description: Observed Behavior: The compliance_test_20 test suite for the SQLAlchemy Spanner dialect is failing on Python 3.13 and 3.14. The failures occur in tests related to schema reflection, specifically wi...
Opengraph URL: https://github.com/googleapis/python-spanner-sqlalchemy/issues/805
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Compliance Test Failures in SQLAlchemy Spanner Dialect","articleBody":"**Observed Behavior:**\n\nThe `compliance_test_20` test suite for the SQLAlchemy Spanner dialect is failing on Python 3.13 and 3.14. The failures occur in tests related to schema reflection, specifically with identifiers that are quoted, contain dots, or have mixed case.\n\n**Environment:**\n\n- Python: 3.13 and 3.14\n- SQLAlchemy: 2.0.45 (as per test logs)\n- Spanner Emulator: latest\n\n**Failure Categories:**\n\n1. **Teardown Errors:** Difficulty dropping schema elements created during tests, suggesting they weren't named or registered as expected.\n\n```\ngoogle.api_core.exceptions.NotFound: 404 fk.with.dots is not a constraint in user_orders\ngoogle.api_core.exceptions.NotFound: 404 Index not found: ix.with.dots\ngoogle.api_core.exceptions.FailedPrecondition: 400 Cannot drop table test_table with indices: IX_test_data.\n```\n\n2. **Reflection Errors for Quoted/Special Names:** The dialect fails to correctly return foreign keys, indexes, and unique constraints when their names include quotes, dots, or mixed case.\n\n* **Foreign Keys:**\n\n```\nAssertionError: 0 != 1\nIn test_get_foreign_keys_quoted_name[FK_users_id]\n\nAssertionError: 'FK_users_id' != 'fk.with.dots'\nIn test_get_foreign_keys_quoted_name[fk.with.dots]\n\nAssertionError: 'FK_users_id' != 'fk_users_id'\nIn test_get_foreign_keys_quoted_name[fk_users_id]\n```\n\n* **Indexes:**\n\n```\nAssertionError: Expected IX_test_data in []\nIn test_get_indexes_quoted_name[IX_test_data]\n\nAssertionError: Expected ix.with.dots in ['IX_test_data']\nIn test_get_indexes_quoted_name[ix.with.dots]\n\nAssertionError: Expected mixedCaseIndex in ['IX_test_data']\nIn test_get_indexes_quoted_name[mixedCaseIndex]\n```\n\n* **Unique Constraints:**\n\n```\nAssertionError: 0 != 1\nIn test_get_unique_constraints_quoted_name[UQ_email]\n```\n\n3. **Incomplete Schema Reflection:** Tests retrieving multiple schema objects show discrepancies in the returned sets.\n\n```\nAssertionError: {'dingalings', 'email_addresses', 'test_table', 'user_orders', 'users',\n'users_ref'} != {'dingalings', 'email_addresses', 'users'}\nIn test_get_table_names[False-_exclusions_01-None-_exclusions_10]\n```\n\n**Suspected Cause:**\n\nThe core issue seems to be the dialect's handling of quoted identifiers and those with special characters or casing within the schema reflection queries against the Spanner \nINFORMATION_SCHEMA. The dialect might not be correctly quoting or escaping these names in the queries, or not properly processing the results.\n\n**Next Steps:**\n\n- Investigate the SQL generated by the dialect for reflection methods.\n- Verify how quoted identifiers are handled in the dialect's parsing logic.\n- Test against a real Cloud Spanner instance to rule out emulator-specific behavior.","author":{"url":"https://github.com/chalmerlowe","@type":"Person","name":"chalmerlowe"},"datePublished":"2025-12-10T12:41:35.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/805/python-spanner-sqlalchemy/issues/805"}
| 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:079d9027-f6c1-4b2c-025c-9f3bf388446e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B764:1ED5CB:6B7EE96:92C4507:69786642 |
| html-safe-nonce | a7c59bfc4e0914871058a03e29248fc65f1062dc3db66ce40ccba3d025ada85a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNzY0OjFFRDVDQjo2QjdFRTk2OjkyQzQ1MDc6Njk3ODY2NDIiLCJ2aXNpdG9yX2lkIjoiNzkxNDU0OTI4OTk2MTQxNjI1OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 4109982ed471810ca3f5c9363fe149672a52ed96ab4785681dc6b4a14b672d2d |
| hovercard-subject-tag | issue:3715046230 |
| 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/python-spanner-sqlalchemy/805/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c32257f1a68be35159243a14e70d08f324244dfac6290aaa07ccc01199727f15/googleapis/python-spanner-sqlalchemy/issues/805 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c32257f1a68be35159243a14e70d08f324244dfac6290aaa07ccc01199727f15/googleapis/python-spanner-sqlalchemy/issues/805 |
| og:image:alt | Observed Behavior: The compliance_test_20 test suite for the SQLAlchemy Spanner dialect is failing on Python 3.13 and 3.14. The failures occur in tests related to schema reflection, specifically wi... |
| 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 | 2981c597c945c1d90ac6fa355ce7929b2f413dfe7872ca5c435ee53a24a1de50 |
| turbo-cache-control | no-preview |
| go-import | github.com/googleapis/python-spanner-sqlalchemy git https://github.com/googleapis/python-spanner-sqlalchemy.git |
| octolytics-dimension-user_id | 16785467 |
| octolytics-dimension-user_login | googleapis |
| octolytics-dimension-repository_id | 335511641 |
| octolytics-dimension-repository_nwo | googleapis/python-spanner-sqlalchemy |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 335511641 |
| octolytics-dimension-repository_network_root_nwo | googleapis/python-spanner-sqlalchemy |
| 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 | 520b65a872113b919c1bbdb03834a50af15859fd |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width