Skip to content

Developer Knowledge fallback search response is not iterable #14609

Description

@aniruddhaadak80

In which file did you encounter the issue?

developer-knowledge/conftest.py and developer-knowledge/search_document_chunks.py

Did you change the file? If so, how?

No.

Describe the issue

The Developer Knowledge samples include a fallback implementation for environments where the preview client is not installed. The fallback SearchDocumentChunksResponse stores its results but is not iterable, while the sample iterates over the response as a pager.

Reproduction command:

python -m pytest developer-knowledge -q

Result:

3 passed, 1 failed
...
developer-knowledge\\search_document_chunks.py:44: in search_document_chunks
    for chunk in response:
TypeError: 'SearchDocumentChunksResponse' object is not iterable

Expected behavior: all four focused tests pass using the intended fallback. Actual behavior: the search test fails before it can exercise the sample.

Environment: Python 3.12, pytest 9.1.1, repository main at commit 430a87ada6f2d33f318b5d16b77464679905a140.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    samplesIssues that are directly related to samples.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions