Developer Knowledge fallback search response is not iterable
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 88/100
Research direction
Start with developer-knowledge/conftest.py to inspect the fallback SearchDocumentChunksResponse, then compare its behavior with the iteration in developer-knowledge/search_document_chunks.py. Run python -m pytest developer-knowledge -q; done means all four focused tests pass and the fallback response can be used by the sample's pager loop.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Jupyter Notebook
- Stars
- 8.1k
- Forks
- 6.7k
- Avg merge
- 4d 4h
- Merged PRs (30d)
- 8
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from GoogleCloudPlatform/python-docs-samples
-
samples
Difficulty 1/5 Under an hour Newbie friendliness 92/100
GoogleCloudPlatform/python-docs-samples#14610 ·
Maintainers usually reply within 1 day
-
samples
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
GoogleCloudPlatform/python-docs-samples#14611 ·
Maintainers usually reply within 1 day
-
chore(generative_ai) Update model references for generative_ai samplesMay be free again @XrossFox claimed this 153 days ago, and no pull request is open. Opensamples
GoogleCloudPlatform/python-docs-samples#14117 · 1 assignee ·
Maintainers usually reply within 1 day
-
Fix Pipeline dependency issues for geospatial-classification/serving_appMay be free again @XrossFox claimed this 164 days ago, and no pull request is open. Opensamples
GoogleCloudPlatform/python-docs-samples#14091 · 1 assignee ·
Maintainers usually reply within 1 day
-
samples
Difficulty 4/5 3-5 days Newbie friendliness 30/100
GoogleCloudPlatform/python-docs-samples#13734 · 4 comments ·
Maintainers usually reply within 1 day
All issues in GoogleCloudPlatform/python-docs-samples
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
PedestrianDynamics/pyFDS-Evac#199 ·
Maintainers usually reply within 1 day
-
agent-reported area/server bug good first issue hacktoberfest help wanted P2
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
kotope/aio_energy_management#196 · 2 comments ·
-
v1 v2
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
modelcontextprotocol/python-sdk#3589 ·
Maintainers usually reply within 1 day