Skip to content

fix(developer-knowledge): make fallback search response iterable - #14613

Open
aniruddhaadak80 wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
aniruddhaadak80:fix/developer-knowledge-fallback-pager
Open

aniruddhaadak80 wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
aniruddhaadak80:fix/developer-knowledge-fallback-pager

Conversation

@aniruddhaadak80

Copy link
Copy Markdown

Description

Fixes #14609

The Developer Knowledge test fallback represented SearchDocumentChunksResponse as an object with a results attribute but did not make that object iterable. The sample intentionally consumes the response as a pager, so environments without the preview client failed before the sample could run. The fallback now yields its stored chunks, matching the real response behavior without changing production code or dependencies.

Validation:

  • python -m pytest developer-knowledge -q — 4 passed
  • Pre-fix run — 3 passed, 1 failed with TypeError: 'SearchDocumentChunksResponse' object is not iterable
  • python -m ruff check developer-knowledge/conftest.py — passed
  • python -m black --check developer-knowledge/conftest.py — passed
  • Live GCP execution was not run because this test exercises the local fallback.

Checklist

Testing

  • I have tested this change on a live environment and verified it works as intended.

Compliance & Style


Post-Approval Actions

  • Please merge this PR for me once it is approved

Fixes GoogleCloudPlatform#14609

Signed-off-by: Aniruddha Adak <aniruddhaadak80@users.noreply.github.com>
@aniruddhaadak80
aniruddhaadak80 requested review from a team as code owners September 25, 2026 03:59
@product-auto-label product-auto-label Bot added the samples Issues that are directly related to samples. label Sep 25, 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 adds an iter method to the SearchDocumentChunksResponse mock class in developer-knowledge/conftest.py to allow iterating over its results. There are no review comments, and I have no feedback to provide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Developer Knowledge fallback search response is not iterable

1 participant