Skip to content

chore(spanner): apply review feedback to merged sample packages - #15032

Open
iennae wants to merge 1 commit into
mainfrom
chore/spanner-merged-samples-review-followup
Open

iennae wants to merge 1 commit into
mainfrom
chore/spanner-merged-samples-review-followup

Conversation

@iennae

@iennae iennae commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

Description

Applies review feedback from the Spanner sample set to the two packages whose first samples are already merged (spanner/search_and_ai from #14836 and spanner/observability from #14857). The same changes were made on the open pull requests; these files had no open pull request to carry them.

  • pyproject.toml (both packages): read dependencies from requirements.txt so the pins live in one place.
  • README.md (both packages): the setup step now uses pip install -e ..
  • vector_search_knn_test.py: patch the client class with autospec=True and document the environment variables the live test needs.
  • disable_builtin_metrics_test.py: remove an unused mock assignment.

No sample code changes.

Checklist

  • I have followed the guidelines from CONTRIBUTING.MD and the Samples Style Guide
  • Tests pass: unit tests for both packages pass locally
  • Lint pass: black, flake8 and mypy are clean on both packages
  • Please merge this PR for me once it is approved

Problem: review of the Spanner sample set asked for stricter tests and a
single source of truth for dependencies. Those changes were applied to the
open pull requests, but the search_and_ai and observability packages were
already merged, so their scaffolding and first tests still used the old form:
dependencies pinned in both pyproject.toml and requirements.txt, a README
install step that skipped the package itself, client mocks without a spec,
and live tests that did not say which environment variables they need.

Solution: read dependencies from requirements.txt in both pyproject.toml
files, update the README setup step to `pip install -e .`, patch the client
class with autospec=True in vector_search_knn_test, and document the required
environment variables above the live tests. No sample code changes.
@iennae
iennae requested review from a team as code owners December 5, 2026 01:38
@product-auto-label product-auto-label Bot added api: spanner Issues related to the Spanner API. samples Issues that are directly related to samples. labels Dec 5, 2026

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

Copy link
Copy Markdown
Contributor

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 updates the installation instructions in the README files for both spanner/observability and spanner/search_and_ai to use 'pip install -e .' instead of installing directly from requirements.txt. Correspondingly, the pyproject.toml files have been updated to dynamically load dependencies from requirements.txt. Additionally, unused variables were cleaned up in disable_builtin_metrics_test.py, and autospec=True was added to the Spanner client mocks in vector_search_knn_test.py along with an explanatory comment for live integration tests. I have no feedback to provide as there are no review comments.

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 Spanner API. samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant