Skip to content

Address SQLAlchemy and Datastore warning coverage - #13

Merged
splasky merged 1 commit into
devfrom
warning
Aug 11, 2026
Merged

Address SQLAlchemy and Datastore warning coverage#13
splasky merged 1 commit into
devfrom
warning

Conversation

@splasky

@splasky splasky commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • Update the dialect for newer SQLAlchemy and Google Datastore client warning paths.
  • Add SQLAlchemy 2 style import_dbapi while keeping dbapi as a compatibility wrapper.
  • Disable SQLAlchemy statement cache support explicitly for this dialect.
  • Use Datastore PropertyFilter where production code builds filters.
  • Avoid deprecated positional add_filter calls in integration tests that only need to locate inserted emulator entities.
  • Improve the unknown BigQuery type test so UNKNOWN_TYPE_XYZ is expected to emit SAWarning and still fallback to NullType.

Python version decision

This PR does not change requires-python. Latest google-cloud-datastore 2.26.0 still declares Python >=3.10 support, so raising this project to Python >=3.11 is a separate support-policy change. I will handle that work on a dedicated branch.

Validation

  • GCLOUD_PATH=/mnt/workspace/code/google-cloud-sdk/bin/gcloud uv run pytest
  • Result: 399 passed, 2 warnings

The remaining warnings are Google client library Python 3.10 EOL notices, not the UNKNOWN_TYPE_XYZ warning covered by this PR.

Update the dialect for newer SQLAlchemy and Google Datastore client behavior without hiding warnings globally.

Add import_dbapi while keeping dbapi as a compatibility wrapper, and set supports_statement_cache to False so SQLAlchemy does not warn about an unsupported statement cache contract.

Use google.cloud.datastore.query.PropertyFilter in get_columns to avoid the Datastore positional add_filter deprecation path. Adjust integration tests that only need to locate inserted emulator entities so they no longer call the deprecated add_filter form.

Improve the unknown BigQuery type unit test to assert the expected SQLAlchemy SAWarning and NullType fallback. UNKNOWN_TYPE_XYZ is intentionally unsupported in the test fixture, so the warning is part of the expected behavior rather than something to suppress.

Do not raise requires-python to 3.11 in this commit. The current google-cloud-datastore 2.26.0 metadata still supports Python >=3.10; moving this project to Python >=3.11 should be handled as a separate support-policy change because Python 3.10 remains inside the declared project range even though Google now warns about its 2026-10-04 EOL.
@splasky
splasky changed the base branch from main to dev August 11, 2026 17:22
@splasky
splasky marked this pull request as ready for review August 11, 2026 17:23
@splasky
splasky force-pushed the warning branch 2 times, most recently from b312b5c to 9383516 Compare August 11, 2026 17:33
@splasky
splasky merged commit 1a34822 into dev Aug 11, 2026
4 checks passed
@splasky
splasky deleted the warning branch August 11, 2026 17:36
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.

1 participant