Skip to content

fix(spanner): modernize adapter config#511

Merged
cofin merged 2 commits into
mainfrom
codex/adapter-config-spanner
Jun 9, 2026
Merged

fix(spanner): modernize adapter config#511
cofin merged 2 commits into
mainfrom
codex/adapter-config-spanner

Conversation

@cofin

@cofin cofin commented Jun 9, 2026

Copy link
Copy Markdown
Member

Summary

Updates the Spanner adapter config to route current Google Cloud Spanner client, instance, database, session-pool, and request execution options.

Details

  • Expands typed connection config for current client settings, directed reads, observability, transaction defaults, instance creation options, database role, encryption, drop protection, and proto descriptors.
  • Replaces stale min_sessions behavior with the session-pool controls used by current Spanner pools, including size, target_size, default_timeout, labels, and max age.
  • Rejects min_sessions early so unsupported pool configuration does not appear to work.
  • Routes session labels from the legacy driver-feature location into pool config for compatibility.
  • Adds retry and timeout driver features and forwards them to execute_sql(), execute_update(), and batch_update().
  • Adds unit coverage for pool selection, client/instance/database kwarg routing, typed config coverage, and retry/timeout execution forwarding.

Review Notes

This branch is rebased onto the latest main; the changes are limited to Spanner config routing and the request execution kwargs needed to honor the new driver features.

@codecov-commenter

codecov-commenter commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.38202% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.44%. Comparing base (2f1a993) to head (6d4ee34).

Files with missing lines Patch % Lines
sqlspec/adapters/spanner/config.py 93.67% 2 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #511      +/-   ##
==========================================
+ Coverage   71.63%   74.44%   +2.81%     
==========================================
  Files         439      439              
  Lines       53427    53490      +63     
  Branches     8460     8464       +4     
==========================================
+ Hits        38270    39819    +1549     
+ Misses      12654    11048    -1606     
- Partials     2503     2623     +120     
Flag Coverage Δ
integration 58.30% <75.28%> (+3.64%) ⬆️
py3.10 71.23% <93.25%> (+9.73%) ⬆️
py3.11 71.26% <93.25%> (+0.03%) ⬆️
py3.12 71.25% <93.25%> (+9.73%) ⬆️
py3.13 71.25% <93.25%> (+9.74%) ⬆️
py3.14 73.55% <88.67%> (+12.83%) ⬆️
unit 61.79% <93.25%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
sqlspec/adapters/spanner/driver.py 72.16% <100.00%> (+0.67%) ⬆️
sqlspec/adapters/spanner/config.py 88.23% <93.67%> (+6.56%) ⬆️

... and 40 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cofin cofin force-pushed the codex/adapter-config-spanner branch from 1b86132 to 213310f Compare June 9, 2026 03:43
@cofin cofin marked this pull request as ready for review June 9, 2026 03:50
@cofin cofin force-pushed the codex/adapter-config-spanner branch 2 times, most recently from 6d4c333 to 6c9cab8 Compare June 9, 2026 17:40
@cofin cofin force-pushed the codex/adapter-config-spanner branch from 6c9cab8 to 2fa84aa Compare June 9, 2026 20:49
@cofin cofin merged commit 5642615 into main Jun 9, 2026
22 checks passed
@cofin cofin deleted the codex/adapter-config-spanner branch June 9, 2026 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants