Skip to content

test: fix conformance tests for SQLAlchemy 2.0#835

Merged
olavloite merged 1 commit intomainfrom
fix-conf2.0-tests
Mar 4, 2026
Merged

test: fix conformance tests for SQLAlchemy 2.0#835
olavloite merged 1 commit intomainfrom
fix-conf2.0-tests

Conversation

@olavloite
Copy link
Contributor

@olavloite olavloite commented Mar 4, 2026

The conformance tests for SQLAlchemy 2.0 were failing due to a dependency conflict for OpenTelemetry. This change removes the use of OpenTelemetry entirely from the tests, as the version that is currently used by the Spanner client library triggers a deprecation warning when used with SQLAlchemy. That in itself is not a big problem, except that the SQLAlchemy tests verify that there are no warnings, and there are no reasonable ways to ignore these warnings, other than just getting rid of the OpenTelemetry usage.

See https://github.com/googleapis/python-spanner-sqlalchemy/actions/runs/22582034832/job/65569068380?pr=825 for an example of the build error that is being fixed.

@olavloite olavloite requested a review from a team as a code owner March 4, 2026 14:40
@product-auto-label product-auto-label bot added the api: spanner Issues related to the googleapis/python-spanner-sqlalchemy API. label Mar 4, 2026
@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a critical issue where conformance tests for SQLAlchemy 2.0 were failing due to a dependency conflict related to OpenTelemetry. The changes involve removing OpenTelemetry from the test suite to avoid deprecation warnings and ensure the tests pass reliably. This improves the overall stability and reliability of the testing process.

Highlights

  • Dependency Conflict Resolution: The primary goal of this PR is to resolve a dependency conflict with OpenTelemetry that was causing conformance tests to fail in SQLAlchemy 2.0.
  • OpenTelemetry Removal: To address the conflict, the PR removes the use of OpenTelemetry from the tests, as the current version used by the Spanner client library triggers a deprecation warning that cannot be easily ignored.
  • Test Stability: By removing OpenTelemetry, the PR aims to stabilize the conformance tests and prevent failures due to deprecation warnings.
Changelog
  • google/cloud/sqlalchemy_spanner/_opentelemetry_tracing.py
    • Refactored to remove direct tracer instantiation to avoid deprecation warnings.
  • noxfile.py
    • Updated session install to remove tracing and force reinstall.
  • test/conftest.py
    • Monkeypatched trace_call to avoid OpenTelemetry usage entirely.
  • test/test_suite_20.py
    • Removed unused imports and skipped tests.
Activity
  • The PR addresses a failing build error in the conformance tests for SQLAlchemy 2.0.
  • The changes focus on removing OpenTelemetry to resolve dependency conflicts and deprecation warnings.
  • The PR aims to stabilize the test suite and ensure reliable test execution.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request fixes failing conformance tests for SQLAlchemy 2.0 by removing OpenTelemetry usage from the test environment. This is achieved by not installing the tracing extras and by monkey-patching trace_call to a no-op function. The changes are logical and effectively address the described issue. I have a couple of suggestions to improve code maintainability.

@olavloite olavloite force-pushed the fix-conf2.0-tests branch from 54ecb56 to a1c2f11 Compare March 4, 2026 14:46
The conformance tests for SQLAlchemy 2.0 were failing due to a dependency
conflict for OpenTelemetry. This change removes the use of OpenTelemetry
entirely from the tests, as the version that is currently used by the Spanner
client library triggers a deprecation warning when used with SQLAlchemy. That
in itself is not a big problem, except that the SQLAlchemy tests verify that
there are no warnings, and there are no reasonable ways to ignore these warnings,
other than just getting rid of the OpenTelemetry usage.
@olavloite olavloite force-pushed the fix-conf2.0-tests branch from a1c2f11 to face32a Compare March 4, 2026 14:51
@olavloite olavloite requested a review from bhatt4982 March 4, 2026 14:58
Copy link
Contributor

@bhatt4982 bhatt4982 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM...

@olavloite olavloite merged commit d23d73d into main Mar 4, 2026
23 checks passed
@olavloite olavloite deleted the fix-conf2.0-tests branch March 4, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: spanner Issues related to the googleapis/python-spanner-sqlalchemy API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants